spatie/laravel-stubs
Opinionated Laravel stub templates from Spatie. Publish customized stubs for migrations, controllers, and models: no down() in migrations, controllers don’t extend a base, no guarded attributes, more return types, fewer docblocks.
BaseController, guarded attributes).stubs-path config or custom stubs, making it adaptable to team-specific conventions.spatie/laravel-stubs) with zero manual setup. Replaces default Laravel stubs via service provider.BaseController, guarded attributes, or verbose docblocks may face resistance or require stub overrides.down() methods) may need manual cleanup or stub replacements.BaseController)?make:model, make:migration, etc.).down() migrations, type hints).composer require spatie/laravel-stubs
php artisan make:model TestModel and verify output (e.g., no down() in migrations).php artisan vendor:publish --tag=laravel-stubs.resources/stubs/ and extend via config:
'stubs-path' => resource_path('stubs'),
make: commands, ensure they respect the package’s stub paths.BaseController) in code reviews.down() methods, no forced inheritance.BaseController).stubs-path config.| Risk | Impact | Mitigation |
|---|---|---|
| Stub conflicts | Broken scaffolding | Publish and override stubs early. |
| Laravel version mismatch | Installation/compatibility errors | Pin Laravel version in composer.json. |
| Team resistance | Adoption failure | Pilot with a subset of developers. |
| Custom stub dependencies | Maintenance burden | Document override strategy upfront. |
make: commands in workflows).down()").How can I help you explore Laravel packages today?