From e6e9237b4d32a609d665c5a352efcfe9b382f476 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 7 Dec 2016 19:59:49 +0200 Subject: [PATCH] Adding support for modules #1131 --- .gitignore | 1 + composer.json | 6 +- composer.lock | 74 ++++++++++++++++--- config/app.php | 2 + config/modules.php | 173 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 246 insertions(+), 10 deletions(-) create mode 100644 config/modules.php diff --git a/.gitignore b/.gitignore index eba40da49d7d..0b0536378eb0 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ Thumbs.db /error_log /auth.json /public/error_log +/Modules /ninja.sublime-project /ninja.sublime-workspace diff --git a/composer.json b/composer.json index 15ff96fa34a5..9bb37aa66315 100644 --- a/composer.json +++ b/composer.json @@ -83,7 +83,8 @@ "fzaninotto/faker": "^1.5", "jaybizzle/laravel-crawler-detect": "1.*", "codedge/laravel-selfupdater": "5.x-dev", - "predis/predis": "^1.1" + "predis/predis": "^1.1", + "nwidart/laravel-modules": "^1.14" }, "require-dev": { "phpunit/phpunit": "~4.0", @@ -103,7 +104,8 @@ "database" ], "psr-4": { - "App\\": "app/" + "App\\": "app/", + "Modules\\": "Modules/" }, "files": [ "app/Libraries/lib_autolink.php", diff --git a/composer.lock b/composer.lock index 2acfb5dadeee..8639e1a79ad7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "cf642e3384eec7504bcdace749d2bb88", - "content-hash": "c0a5b571bc2305c4b0d9eae18bf5011b", + "hash": "5d41e236e8354f33899fbac05995eaee", + "content-hash": "cf263546eb8ba91f81f26bdc5470573e", "packages": [ { "name": "agmscode/omnipay-agms", @@ -859,12 +859,12 @@ "version": "v2.0.4", "source": { "type": "git", - "url": "https://github.com/coatesap/omnipay-datacash.git", + "url": "https://github.com/digitickets/omnipay-datacash.git", "reference": "77915db87635c514576550dd15355987cadefc78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/coatesap/omnipay-datacash/zipball/77915db87635c514576550dd15355987cadefc78", + "url": "https://api.github.com/repos/digitickets/omnipay-datacash/zipball/77915db87635c514576550dd15355987cadefc78", "reference": "77915db87635c514576550dd15355987cadefc78", "shasum": "" }, @@ -909,6 +909,7 @@ "pay", "payment" ], + "abandoned": "digitickets/omnipay-datacash", "time": "2015-01-08 11:19:06" }, { @@ -916,12 +917,12 @@ "version": "v2.0.0", "source": { "type": "git", - "url": "https://github.com/coatesap/omnipay-paymentsense.git", + "url": "https://github.com/digitickets/omnipay-paymentsense.git", "reference": "4a5a87ef140abf8e09ff27cd0e6502ac1e79e434" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/coatesap/omnipay-paymentsense/zipball/4a5a87ef140abf8e09ff27cd0e6502ac1e79e434", + "url": "https://api.github.com/repos/digitickets/omnipay-paymentsense/zipball/4a5a87ef140abf8e09ff27cd0e6502ac1e79e434", "reference": "4a5a87ef140abf8e09ff27cd0e6502ac1e79e434", "shasum": "" }, @@ -967,6 +968,7 @@ "payment sense", "paymentsense" ], + "abandoned": "digitickets/omnipay-paymentsense", "time": "2014-03-18 17:17:57" }, { @@ -974,12 +976,12 @@ "version": "v2.1.3", "source": { "type": "git", - "url": "https://github.com/coatesap/omnipay-realex.git", + "url": "https://github.com/digitickets/omnipay-realex.git", "reference": "9a751a66c7fdd610a7c41493a57587d59944bbfa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/coatesap/omnipay-realex/zipball/9a751a66c7fdd610a7c41493a57587d59944bbfa", + "url": "https://api.github.com/repos/digitickets/omnipay-realex/zipball/9a751a66c7fdd610a7c41493a57587d59944bbfa", "reference": "9a751a66c7fdd610a7c41493a57587d59944bbfa", "shasum": "" }, @@ -1021,6 +1023,7 @@ "purchase", "realex" ], + "abandoned": "digitickets/omnipay-realex", "time": "2015-01-08 10:05:58" }, { @@ -4431,6 +4434,60 @@ ], "time": "2016-04-19 13:41:41" }, + { + "name": "nwidart/laravel-modules", + "version": "1.14.0", + "source": { + "type": "git", + "url": "https://github.com/nWidart/laravel-modules.git", + "reference": "2d05b9c5ac23cb800725ba760d9a323820603d9f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nWidart/laravel-modules/zipball/2d05b9c5ac23cb800725ba760d9a323820603d9f", + "reference": "2d05b9c5ac23cb800725ba760d9a323820603d9f", + "shasum": "" + }, + "require": { + "laravel/framework": "5.1.*|5.2.*|5.3.*", + "laravelcollective/html": "5.1.*|5.2.*|5.3.*", + "php": ">=5.5" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^1.11", + "mockery/mockery": "~0.9", + "orchestra/testbench": "^3.1|^3.2|^3.3", + "phpro/grumphp": "^0.9.1", + "phpunit/phpunit": "~4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Nwidart\\Modules\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Widart", + "email": "n.widart@gmail.com", + "homepage": "https://nicolaswidart.com", + "role": "Developer" + } + ], + "description": "Laravel Module management", + "keywords": [ + "laravel", + "module", + "modules", + "nwidart", + "rad" + ], + "time": "2016-10-19 09:27:32" + }, { "name": "omnipay/2checkout", "version": "dev-master", @@ -6714,6 +6771,7 @@ "pay", "payment" ], + "abandoned": "digitickets/omnipay-barclays-epdq", "time": "2016-06-09 16:42:25" }, { diff --git a/config/app.php b/config/app.php index 985fdcc6d40b..9e1784529047 100644 --- a/config/app.php +++ b/config/app.php @@ -156,6 +156,7 @@ return [ Websight\GcsProvider\CloudStorageServiceProvider::class, 'Jaybizzle\LaravelCrawlerDetect\LaravelCrawlerDetectServiceProvider', Codedge\Updater\UpdaterServiceProvider::class, + Nwidart\Modules\LaravelModulesServiceProvider::class, /* * Application Service Providers... @@ -259,6 +260,7 @@ return [ 'PushNotification' => 'Davibennun\LaravelPushNotification\Facades\PushNotification', 'Crawler' => 'Jaybizzle\LaravelCrawlerDetect\Facades\LaravelCrawlerDetect', 'Updater' => Codedge\Updater\UpdaterFacade::class, + 'Module' => Nwidart\Modules\Facades\Module::class, ], ]; diff --git a/config/modules.php b/config/modules.php new file mode 100644 index 000000000000..0359afe85624 --- /dev/null +++ b/config/modules.php @@ -0,0 +1,173 @@ + 'Modules', + + /* + |-------------------------------------------------------------------------- + | Module Stubs + |-------------------------------------------------------------------------- + | + | Default module stubs. + | + */ + + 'stubs' => [ + 'enabled' => false, + 'path' => base_path() . '/vendor/nwidart/laravel-modules/src/Commands/stubs', + 'files' => [ + 'start' => 'start.php', + 'routes' => 'Http/routes.php', + 'json' => 'module.json', + 'views/index' => 'Resources/views/index.blade.php', + 'views/master' => 'Resources/views/layouts/master.blade.php', + 'scaffold/config' => 'Config/config.php', + 'composer' => 'composer.json', + ], + 'replacements' => [ + 'start' => ['LOWER_NAME'], + 'routes' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'], + 'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'], + 'views/index' => ['LOWER_NAME'], + 'views/master' => ['STUDLY_NAME'], + 'scaffold/config' => ['STUDLY_NAME'], + 'composer' => [ + 'LOWER_NAME', + 'STUDLY_NAME', + 'VENDOR', + 'AUTHOR_NAME', + 'AUTHOR_EMAIL', + 'MODULE_NAMESPACE', + ], + ], + ], + 'paths' => [ + /* + |-------------------------------------------------------------------------- + | Modules path + |-------------------------------------------------------------------------- + | + | This path used for save the generated module. This path also will added + | automatically to list of scanned folders. + | + */ + + 'modules' => base_path('Modules'), + /* + |-------------------------------------------------------------------------- + | Modules assets path + |-------------------------------------------------------------------------- + | + | Here you may update the modules assets path. + | + */ + + 'assets' => public_path('modules'), + /* + |-------------------------------------------------------------------------- + | The migrations path + |-------------------------------------------------------------------------- + | + | Where you run 'module:publish-migration' command, where do you publish the + | the migration files? + | + */ + + 'migration' => base_path('database/migrations'), + /* + |-------------------------------------------------------------------------- + | Generator path + |-------------------------------------------------------------------------- + | + | Here you may update the modules generator path. + | + */ + + 'generator' => [ + 'assets' => 'Assets', + 'config' => 'Config', + 'command' => 'Console', + 'event' => 'Events', + 'listener' => 'Events/Handlers', + 'migration' => 'Database/Migrations', + 'model' => 'Entities', + 'repository' => 'Repositories', + 'seeder' => 'Database/Seeders', + 'controller' => 'Http/Controllers', + 'filter' => 'Http/Middleware', + 'request' => 'Http/Requests', + 'provider' => 'Providers', + 'lang' => 'Resources/lang', + 'views' => 'Resources/views', + 'test' => 'Tests', + 'jobs' => 'Jobs', + 'emails' => 'Emails', + 'notifications' => 'Notifications', + ], + ], + /* + |-------------------------------------------------------------------------- + | Scan Path + |-------------------------------------------------------------------------- + | + | Here you define which folder will be scanned. By default will scan vendor + | directory. This is useful if you host the package in packagist website. + | + */ + + 'scan' => [ + 'enabled' => false, + 'paths' => [ + base_path('vendor/*/*'), + ], + ], + /* + |-------------------------------------------------------------------------- + | Composer File Template + |-------------------------------------------------------------------------- + | + | Here is the config for composer.json file, generated by this package + | + */ + + 'composer' => [ + 'vendor' => 'nwidart', + 'author' => [ + 'name' => 'Nicolas Widart', + 'email' => 'n.widart@gmail.com', + ], + ], + /* + |-------------------------------------------------------------------------- + | Caching + |-------------------------------------------------------------------------- + | + | Here is the config for setting up caching feature. + | + */ + 'cache' => [ + 'enabled' => false, + 'key' => 'laravel-modules', + 'lifetime' => 60, + ], + /* + |-------------------------------------------------------------------------- + | Choose what laravel-modules will register as custom namespaces. + | Setting one to false will require to register that part + | in your own Service Provider class. + |-------------------------------------------------------------------------- + */ + 'register' => [ + 'translations' => true, + ], +];