Repository navigation
Releases
v12.0.6
Upgrade notes
Security release for Laravel 12. v12.0.5 and earlier are affected: update with composer update nwidart/laravel-modules. Most apps need no other change.
Show upgrade notes
Behaviour changes
module:installexits 1 when an install fails and skipsmodule:updatefor that module. It exited 0 before. Withmodules.json, the remaining entries still install. (#2280)module:installrejects an empty version, a version that starts with-, and a--typethat resolves to no repository URL. (#2280)
Extending the package
Security
- install:
module:installno longer passes the module name, version, path or repository URL through the shell, which allowed command injection from the CLI or a committedmodules.json.module:updateescapes the packages it reads from a module'scomposer.json. Backport of #2174, released in v13.1.0 (#2280, db2d7da)
Full Changelog: v12.0.5...v12.0.6
v13.3.0
Features
- stubs: Align command and job stubs with Laravel 13 (#2238) (b28dee5)
- make: Add --json-api option to module:make-resource (#2241) (485c3e3)
- commands: Add module:make-config and module:make-job-middleware (#2242) (63c7d24)
- make-model: Add --attributes flag for attribute-style models (#2243) (36557a8)
Bug Fixes
- make: Add #[UseFactory] to module models generated with --factory (#2237) (db74e5f)
- make: Reject empty generator names and seeders named Seeder (#2246) (90db932)
Performance
- providers: Skip module config scan on cached web requests (#2230) (82f948e)
- repository: Read module.json once per app and cache scans in tests (#2231) (721cbb8)
- provider: Register module schedules only when Schedule resolves (#2239) (99c3e36)
Refactor
Other
v13.2.0
Upgrade notes
Most apps on the default published config need no change. Read the items below if you use custom stubs, custom generator paths, or run module commands in scripts, CI or deploys.
Show upgrade notes
Action may be required
- Custom
stubs.pathneeds'stubs' => ['enabled' => true]. Without it the path is ignored (#2198) - Custom
paths.generator.<key>withoutnamespace(actions,casts,enums,exceptions,helpers,interfaces,repository,services,traits) now derives the namespace frompath. Addnamespaceto keep the old one (#2207) module:makerejects generator paths outsidepaths.app_folder, and withapp_folder => ''paths that do not match their StudlyCase namespace (Providers, notapp/Providers). It exits 1 and lists the bad keys (#2209, #2225)generate => falsealso skips the stub files the key owns.'assets' => falseno longer writesvite.config.jsandpackage.json. Set the key totrueto get them back (#2223)- Published
route-provider.stub/scaffold/provider.stub: old copies keep working as before. To get the new behaviour (routes dropped when not instubs.filesorroutes.generateis false; provider list follows generated providers), copy the%%START_WEB_ROUTES%%/%%END_WEB_ROUTES%%and%%START_API_ROUTES%%/%%END_API_ROUTES%%markers andprotected array $providers = [$PROVIDERS$];fromsrc/Commands/stubs/(#2216, #2180) - No published
config/modules.php: translation auto-discovery is now off. Publish the config and set'auto-discover' => ['translations' => true]if you relied on it (#2184) module:publish-translationwrites tolang/modules/{module}. Move old copies fromresources/lang/{module}. Whileresources/langexists,lang_path()points to it andlang/stops loading. Modules generated with v11 stubs: uselang_path('modules/...')instead ofresource_path('lang/modules/...')(#2185)- Module config files other than
config.phppublish toconfig/<module>/<file>.php. Move files published earlier (#2186) modules_statuses.jsonmust be a JSON object (module name totrue/false). A corrupt file or a badmodules.activatorconfig now throws (#2205)
Behaviour changes
- Scripts, CI and deploys: a module command with no module and no
--allin non-interactive mode printsNo module given. Pass a module name or --all.and exits 1 (it did nothing and exited 0). Add--allor module names (#2212) --allnow runs non-interactively (-n, CI, scheduler):module:delete --all --force -ndeletes every module (#2187)- More failures exit 1: failing seeders and nested calls,
module:langwith missing translations,module:make-middlewareandmodule:make-observerwhen the file exists (#2212, #2215, #2210) module:makerequiresnamewhen non-interactive (#2210)module:migrate --subpathis now honoured.module:migrate-fresh --pretendis refused (#2212)module:publish-translationandmodule:publish-migrationskip existing files. Pass--forceto overwrite (#2199)- Scheduled
module:prunenow deletes records (it found no models before) (#2197) - Reset and refresh also roll back
loadMigrationsFrom()paths, so those tables are dropped too (#2226) - Rollback and reset run
down()on the migration's connection ($connection, else--database). Check secondary databases (#2179) - Module listeners registered by hand and found by event discovery run twice. Remove one registration and re-run
event:cache(#2219) aliasesinmodule.jsonare now registered. Check for clashes (#2206)
Extending the package
InstallerandPublisherproperties are nullable (redeclare them as nullable);Publisherdefaults to$force = false(#2181, #2211, #2199)BaseCommandsubclasses overridinginitialize()must callparent::initialize()(#2187)GeneratorCommandadds aforceoption: remove your own (#2210)MigrateCommandhas no constructor,$migratoror$migration_list(#2226)
Deprecated (removed in v14)
Module::boot(), register(), registerTranslation(), isLoadFilesOnBoot(); FileRepository::boot() and register() (and on RepositoryInterface); ModuleEvent::BOOT and REGISTER; Traits\MigrationLoaderTrait; config keys modules.register.translations and modules.register.files; ContractsServiceProvider (#2204, #2196)
Features
Bug Fixes
- make: Look up created module by studly name when firing events (d175b6a)
- migrations: Run rollback and reset down() on the selected connection (#2179) (17eca88)
- make: Only list generated route/event providers in module $providers (#2180) (3ac69c1)
- install: Allow module:install without version or --path (#2181) (f57a825)
- Keep module_vite() from mutating the shared Vite instance (#2183) (2dff505)
- Disable translation auto-discovery when modules config is not published (#2184) (2a2cb53)
- Load translations published by module:publish-translation (#2185) (8443999)
- Publish module config files to the path of their config key (#2186) (a97db87)
- Resolve --all without interaction and honour --direction (#2187) (8613953)
- publish: Fail with ModuleNotFoundException for unknown module in module:publish-config (#2195) (22c3f37)
- Register the module repository as a single shared instance (#2196) (478968a)
- prune: Discover module models and skip missing models directories (#2197) (b8e7743)
- Use package stubs unless stubs.enabled is true (#2198) (deedc70)
- publish: Keep published translations and migrations unless --force is given (#2199) (c96304f)
- Remove the app folder as a path prefix instead of with ltrim() (#2200) ([a6b3ba6](https://github.com/nWidart/laravel-modules/comm...
v13.1.0
Security
- install:
module:installno longer passes the module name, version, path or repository URL through the shell, which allowed command injection from the CLI or a committedmodules.json. A failed install now exits with an error instead of runningmodule:update(#2174, 25c4847)
Features
- boost: Add Laravel Boost support: a core guideline and a
laravel-modules-developmentskill, by @rupeshstha (#2156, 63d90fa, 8dc6deb)
Bug Fixes
- migrations:
module:migrate-freshasks for confirmation in production before wiping the database (#2173, 9c27d35) - migrations:
module:migrate <Module>no longer runs the app's migrations or those of another module with a similar name (#2171, 4917d29) - migrations: Honour
--pretendonmodule:migrate-rollbackandmodule:migrate-reset, and ask for confirmation before a rollback in production (#2175, d7bab5e) - translations: Fix module translation loading missing its namespace, by @joaopluis (#2154, aed5d54)
Maintenance
- ci: Add the release workflows and a Conventional Commits check on pull requests (#2176, 99c5d08)
- ci: Modernize the CI workflow, stop duplicate runs, and remove the Travis CI and Scrutinizer config (6f30986, 65444f8)
- tests: Bump phpunit in the Recipe test fixture to a patched version (#2172, cab48f1)
- docs: Add
AGENTS.mdagent guidance and fixFUNDING.ymlso both sponsor accounts show (fe7e532, 178ca04)
v13.0.0
What's Changed
- Laravel 13.x Compatibility by @laravel-shift in #2138
- prep for l13 by @dcblogdev in #2146
New Contributors
- @laravel-shift made their first contribution in #2138
Full Changelog: v12.0.5...v13.0.0
v12.0.5
What's Changed
- Replace Hardcoded Paths with Configurable Values in
UpdatePhpunitCoverageCommand by @cndrsdrmn in #2108 - [fix] fix return type of method by @alissn in #2101
- Add
PLURAL_UPPER_NAMEto Module Creation Replacement Variables by @alissn in #2102 - Fix publishing config files for modules with multi-word names by @alissn in #2100
- Test against php 8.5 by @sergiy-petrov in #2121
- fix: correct Module parameter type in ActivatorInterface by @alissn in #2125
- Rename 'Disabling module' to 'Enabling module' in EnableCommand by @itshichabk in #2135
- fix(generator): resolve model namespace without app/ prefix in module observer stub by @malayvuong in #2112
- refactor: introduce ModuleServiceProvider base class to reduce boilerplate by @dominosaurs in #2115
- fix: resolve module helper dependency issues during service provider registration by @tareq-alqadi in #2118
- Add support for class-based replacements instead of closures by @alissn in #2119
- set default value for migration table configuration key by @dcblogdev in #2143
- use config instead of env for Vapor maintenance mode check by @dcblogdev in #2144
- Inertia support by @dcblogdev in #2145
New Contributors
- @cndrsdrmn made their first contribution in #2108
- @itshichabk made their first contribution in #2135
- @malayvuong made their first contribution in #2112
- @dominosaurs made their first contribution in #2115
Full Changelog: v12.0.4...v12.0.5
v12.0.4
What's Changed
- Fix: add missing closing tag by @ukeloop in #2060
- [fix] fix Error Cannot instantiate abstract class by @alissn in #2062
- Refactor
modulehelper, improve code clarity, and handle exceptions by @alissn in #2063 - Refactor: Type property with interface instead of concrete class for better extensibility by @serhii-solodkyi in #2069
- Add ListCommands Command by @dcblogdev in #2081
- Ensure modules are registered in register phase by @tareq-alqadi in #2089
New Contributors
- @ukeloop made their first contribution in #2060
- @serhii-solodkyi made their first contribution in #2069
- @tareq-alqadi made their first contribution in #2089
Full Changelog: v12.0.3...v12.0.4
v12.0.3
What's Changed
- Hot fixes for mismatch variables by @dcblogdev in #2059
Full Changelog: v12.0.2...v12.0.3
v12.0.2
What's Changed
- Create
module()helper function and@module()blade directive by @solomon-ochepa in #2044 - Feature/pluralize module route paths by @solomon-ochepa in #2045
- Enhance Config Merging Logic to Prevent Duplicate Keys in Modules by @solomon-ochepa in #2052
- fix: update master view path to new component structure by @dcblogdev in #2055
- fix: update component namespace generation in module make command tests by @dcblogdev in #2056
- Allow Module Configs to Override Root Application Configs by @solomon-ochepa in #2053
Full Changelog: v12.0.1...v12.0.2
v12.0.1
What's Changed
- Added missing type hinting for helpers.php by @edgarsn in #2030
- Update Stubs to Follow Laravel Pint Standards by @solomon-ochepa in #2035
- [new feature] Module plural names by @solomon-ochepa in #2036
- Bumps dependencies by @alissn in #2037
- [delete] delete unused files and command and test by @alissn in #2038
- allow
moduleandmodule_namespaceto be used inside migrations by @dcblogdev in #2039 - Make model with flags by @dcblogdev in #2041
- Add Support for Closures in Stub Variable Replacement by @alissn in #2040
New Contributors
Full Changelog: v12.0.0...v12.0.1