Stubs in Laravel — a practical guide to Laravel stubs with clear examples you can reuse in real projects.
Laravel Tutorial Series (22/27). Prefer one page? Read the complete Laravel tutorial (all 27 topics).
Short description
Stubs are templates Artisan uses when generating controllers, models, migrations, and more. Customize them to match your team standards.
Publish stubs
php artisan stub:publish
Files appear in `/stubs`.
Example idea
Edit `stubs/model.stub` to always include SoftDeletes or default `$fillable`.
Generate using your stub
php artisan make:model Comment
Artisan uses your customized stub automatically.
Why it helps
Consistent namespaces, docblocks, traits, and base classes across every generated file.