rawilk/laravel-stubs
Opinionated Laravel stubs with strict types, fewer docblocks, unguarded models, controllers without a base class, migrations without down methods, and added return type hints. Publish via artisan and optionally keep stubs updated via composer hooks.

This repo contains opinionated versions of the Laravel stubs. The most notable changes are:
down functiondeclare(strict_types=1); added to most filesYou can install the package via composer:
composer require rawilk/laravel-stubs --dev
If you want to keep your stubs up-to-date with every update, add this composer hook to your composer.json file:
"scripts": {
"post-update-cmd": [
"@php artisan custom-stub:publish --force"
]
}
You can publish the stubs using this command:
php artisan custom-stub:publish
If you're developing a package, you may pull these stubs in to your package and generate them just like you would with a normal Laravel project. This is possible when used with Orchestral Canvas. On your package project, run the following command:
composer require --dev rawilk/laravel-stubs orchestra/canvas
Next you need to run:
composer exec canvas preset package
Finally, modify the generated canvas.yaml file:
preset: Rawilk\Stubs\Canvas\Package
namespace: YourPackageNamespace
To generate a file, you can run the following command:
composer exec canvas make:migration CreatePostsTable --create
Running this would generate a migration normally, just like the php artisan make:migration command would. For more information on canvas, please refer to their documentation.
Tip: Create an alias for composer exec canvas in your profile to allow easier entering of your generator commands. I personally added the following alias to my bash profile:
alias canvas="composer exec canvas"
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.
How can I help you explore Laravel packages today?