laravel-stubs maintained by thedoctor0
Description
Opinionated versions of the Laravel stubs for Artisan make commands
Author
Last update
2026/08/10 15:51
(dev-master)
License
Downloads
7
Tags
Laravel Stubs
This package contains opinionated versions of the Laravel stubs for Artisan make commands.
Version support
| Package | Laravel | PHP |
|---|---|---|
| 2.x | 11.x, 12.x, 13.x | 8.2+ |
| 1.x | 8.x | 7.4+ |
Changes
strict_typesare declared by default- return type hints are present where possible
- missing parameter type hints have been added
- migrations use anonymous classes and don't have a
downfunction - the model stub ships a
casts()method - form requests don't have an
authorizefunction - extra stubs Laravel doesn't publish: enums, plain classes, traits, scopes, inbound casts, singleton controllers, and Pest tests
Installation
You can install the package via composer:
composer require thedoctor0/laravel-stubs --dev
If you want to keep stubs up to date, add this hook to your composer.json file:
"scripts": {
"post-update-cmd": [
"@php artisan stubs:publish --force"
]
}
Usage
You can publish the stubs using this command:
php artisan stubs:publish
Already-published stubs are skipped unless you pass --force.
Testing
composer test
Credits
License
The MIT License (MIT). Please see license file for more information.