nwidart/laravel-modules
Laravel package for structuring large apps into self-contained modules (like mini packages) with their own controllers, models, views, routes, and config. Includes Artisan generators, module discovery, and configuration for organizing and scaling projects.
php artisan vendor:publish --provider="Nwidart\Modules\LaravelModulesServiceProvider" --tag="stubs"View/Component to View/Componentssignature to namemodule:make-component command to generate laravel componentsTarget class [Nwidart\Modules\Commands\] does not exist.--web, --api and --plain options.$signature property instead of $nameorder was used instead of priorityListenerMakeCommand to properly use the --events optionIlluminate\Http\Resources\Json\JsonResource. (#969)Illuminate\Contracts\Support\Renderable. (#1020)php artsian module:enable (without any arguments) will enable all modulesphp artsian module:disable (without any arguments) will disable all modulesGeneratorPath class)RouteServiceProvider and ModuleServiceProvidermodule:delete commandmodule_path helper (PR#861)module_statuses.json file has been moved to the Application's base path. This is to improve its visibility and the fact that it can be committed by default.New File Activator feature. PR #790 from @ryssbowh
This feature changes how modules are activated and de-activated. Currently module statuses are stored on disk, this features adds the possibility of storing this status information in a database.
Use the command php artisan module:v6:migrate to have old modules active status migrated to the new system.
Alternate way to define the namespace of modules in PR #776 by @daison12006013
This allows to have the content of the module under an src/ folder for example.
BREAKING New way to handle active and inactive modules.
Modules don't store their active status in their module.json file anymore, but in a file under the storage folder.
Run php artisan module:v6:migrate to use the new system.
BREAKING Renamed method enabled to isEnabled in \Nwidart\Modules\Module.
BREAKING Renamed method disabled to isDisabled in \Nwidart\Modules\Module.
BREAKING Renamed method enabled to isEnabled in \Nwidart\Modules\FileRepository.
BREAKING Renamed method disabled to isDisabled in \Nwidart\Modules\FileRepository.
BREAKING Removed the __get magic method on the \Nwidart\Modules\Module class. Use get() or json()->get() instead.
The module:make-listener command now correctly uses the namespace configuration
The generated Factories now has type hints for the \Illuminate\Database\Eloquent\Factory class
Improved foreign key constraint generation
Exception handling in the SeedCommand has been improved
artisan module:route-provider has a --force option to overwrite existing fileRouteServiceProvider generation to properly use the routes/web and routes/api stubs[@stop](https://github.com/stop) with [@endsection](https://github.com/endsection) in the view stub fileModule class does not extend Laravel's Service Provider class anymore--api argument to module:make-controller commandModules namespacemodule:seed accepts a --class optionmodule:make-controller Api\\TestControllermodule:update command has now the possibility to update all modules at once--class to the SeedCommand.module:make-migration commandmodule:migrate-refresh commandmake:model command with the -m flag to create the associated migration is now using a current migration file name{!! Module::asset() !!}json() method, while keeping the performance improvements.resource_path to register module views--plain on the make:module command, to not include a service provider in the module.json file as it's not generated.GenerateNotificationCommand.Macroable trait to the Module class.collections method now accepts an optional parameter to get modules by status, in a laravel collection.5.5.* to be used.module:update: Copy over the scripts key to main composer.json file--subpath option to migrate commandmodule:update: Install / require all require & require-dev package at once, instead of multiple calls to composer require.module:publish-config command now uses the namespace set up in the configuration file.module:update command now also takes the require-dev key into account$migrations parameter optional on getLastBatchNumber()module:list) now returns the native module namestart.phpMacroable trait to Module class (PR #116)Schema facade on migration stubsmodule:reset and module:migrate-rollback didn't have --database option (PR #88)Module::asset(), removed obsolete backslash. (PR #91)module:make-notification command to generate a notification classlists() method on the laravel collection has been removed in favor of pluck()module.json fileEmails folder by defaultmodule:make-job command to generate a job classController appended to it as well. Previously only the file had it suffixed.pingpong/support and pingpong/generatorsStudlyCase (Issue #14)Initial release
Module class: Deprecated active() method, use enabled()Module class: Deprecated notActive() method, use disabled()Repository class: Deprecated addPath() method, use addLocation()Repository class: Deprecated get() method, use find()Repository class: Deprecated getUsed() method, use getUsedNow()Repository in ContractsServiceProvider--migration flag to the module:make-model command to generate the migration file with a modelmodule:make command without the --plain flag, or using module:make-provider with the --master flag.module_path() helper function.Listeners/, from Events/HandlersHow can I help you explore Laravel packages today?