Repository navigation
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)
- make-migration: Keep every field and reverse fields correctly in generated migrations (#2202) (c00656a)
- prune: Resolve modules through the repository (#2203) (26da9dc)
- Fail clearly on bad activator config, corrupt statuses and unknown modules (#2205) (c1a91e6)
- Build generated namespaces and paths from config (#2207) (d19f7bb)
- Register module aliases, fix module:list --only=priority and the module cache path (#2206) (096ac14)
- make: Stop module:make when generator paths are outside app_folder (#2209) (7158607)
- commands: Return a failure status, validate modules up front and make migration commands safe (#2212) (2930a41)
- install: Keep composer.json and phpunit.xml intact and handle failed installs (#2211) (0fb8ffb)
- make: Return errors from generators, add --force everywhere and reject paths outside the module (#2210) (5404e9b)
- stubs: Render stub placeholders in one pass and escape values per output format (#2213) (828eb93)
- make: Stop module:make on invalid JSON stubs and report composer dump-autoload failures (#2214) (824b33a)
- Fail module:lang on missing translations, read plural generator namespaces, fix --force help (#2215) (200c8dc)
- Skip routes removed from stubs.files in generated RouteServiceProvider (#2216) (7155187)
- events: Discover module listeners with Laravel event discovery (#2219) (2bb8b99)
- make: Skip stub files whose generator is disabled (#2223) (7d77a57)
- make: Reject root-mapped generator paths that mismatch their namespace (#2225) (f59c6aa)
- make: Keep fully qualified --event class in module:make-listener (#2224) (a45a878)
- migrations: Use the same module migration paths in every module:migrate command (#2226) (f273571)
- seed: Warn when module:seed finds no seeder to run (#2227) (87f0ad4)
Refactor
Documentation
- Document the trail code map in AGENTS.md (#2182) (c2818c7)
- Rewrite README and add social preview image (#2194) (98922a5)
- agents: Never use git stash in a worktree (#2201) (e20271d)