The package ships config/config.php and merges it under the modules key. The config tag of vendor:publish copies it to config/modules.php (see vendor:publish tags). A value is read with config('modules.<key>'), for example config('modules.paths.modules').
Keys marked deprecated have no effect in version 13 and are removed in version 14.
Root namespace of the modules. Generators and ModuleServiceProvider prefix class namespaces with it. module:make writes it to autoload.psr-4 in the module composer.json. The application composer.json must merge that file via extra.merge-plugin.include (matching paths.modules).
vapor_maintenance_mode
env('VAPOR_MAINTENANCE_MODE', false)
When true, places the modules.php providers manifest next to Laravel’s config cache instead of its services cache (bootstrap/cache/modules.php by default).
activator
'file'
Name of the active activator: a key of activators. An unknown name throws InvalidActivatorClass.
commands
ConsoleServiceProvider::defaultCommands() merged with an empty list
List of Artisan command class names. ConsoleServiceProvider registers every class in the list.
The commands value is an array of class names. The default config/config.php builds it from the default commands and a merge() call that takes the extra class names:
module:make always writes module.json from the json stub, so json is not in stubs.files. module:make adds missing default keys automatically unless mapped to a custom class:
Folder that holds modules. module:make writes here, and the repository always scans it. Match it in extra.merge-plugin.include (default Modules/*/composer.json) so classes autoload. See Installation.
paths.assets
public_path('modules')
Folder where module:publish copies module assets, one sub-folder per module. module:setup creates it.
paths.migration
base_path('database/migrations')
Folder where module:publish-migration copies module migrations.
paths.app_folder
'app/'
Folder inside each module that holds its classes. The module composer.json maps the module namespace to it. Every class generator path (actions through request below) must sit inside it, or module:make stops. Set '' to map to the module root, then drop the app/ prefix and use StudlyCase folders.
Folder inside the module, relative to the module root.
generate
true: module:make creates the folder (and the files it owns, see below). false or missing: module:make does not create it. The generator command that uses the key still works.
namespace
Optional. Namespace of the generated classes, relative to the module namespace. Default: path without paths.app_folder, converted to a namespace.
A plain string value is read as path, and generate is then true when the string is not empty. A false value disables the key.
Setting generate to false also skips the stubs.files that a key owns:
The health key is not in config/config.php, but the code reads it. module:make-health-indicator defaults to paths.app_folder plus Health (app/Health). Set modules.paths.generator.health with path and optional namespace to override it. A configured health path must stay inside paths.app_folder, or module:make stops.
The event-provider key is not in config/config.php, but the code reads it. module:make-event-provider writes to the provider path. module:make generates EventServiceProvider when event-provider.generate is true, or when event-provider has no path and provider.generate is true.
Registers each enabled module’s lang path with the translator under the lower-case module namespace and as a JSON path. ModuleServiceProvider::registerTranslations() registers the same namespace. See Translations.
Activator definitions, keyed by name and selected via activator. Each entry defines a class implementing Nwidart\Modules\Contracts\ActivatorInterface. The container instantiates it with new $class($app).
activators.file.class
Nwidart\Modules\Activators\FileActivator::class
Default activator.
activators.file.statuses-file
base_path('modules_statuses.json')
JSON file where FileActivator stores module statuses. Missing modules count as disabled. module:update-phpunit-coverage reads it too.