mll-lab/laravel-strict-stubs
Laravel Strict Stubs replaces Laravel’s default scaffolding stubs with stricter versions, so generated models, controllers, and other classes include declare(strict_types=1) and opinionated defaults. A small package for teams that want consistent, stricter code from the first Artisan make command.
make:model, make:controller, and make:migration emit declare(strict_types=1), final classes, and explicit return types. Nothing here changes end-user behavior; it changes the first draft of every new file. Frame it as developer experience infrastructure and keep it off the customer-facing roadmap.php artisan stub:publish and committing the results) or consumes an external baseline. Given this package is archived, the honest answer for most teams is build: copy the ideas, publish your own stubs, and own them. Buying only makes sense if the upstream is actively maintained, and this one is not.app/ or database/.make:migration to a reviewable PR and shift review attention from formatting to schema and domain design.Consider adopting (or, more realistically, mining it for ideas) when:
final by default in newly generated files and have no house standard yet — read the stub files as a reference implementation, then publish your own.Look elsewhere / do not adopt as a dependency when:
php artisan stub:publish, a code review, and a commit get you the same outcome with no supply-chain surface and no dependency to track.Net PM recommendation: treat this as research input, not a dependency. Vendor the ideas into your own published stubs.
For executives (one paragraph): This is a developer-tooling package that changes what php artisan make:* produces — strict types, final classes, explicit return types — so new code starts compliant with our quality gates instead of needing cleanup. It carries no runtime risk and no customer-facing impact. However, the project is archived, has negligible adoption, and has not been updated since early 2023, so I do not recommend taking it as a dependency. Instead I recommend a small, bounded internal task: publish our own strict stubs modeled on this package's approach. Cost is a day or two of engineering; the return is that every future scaffolded file arrives typed, formatted, and lint-clean, which compounds across the codebase and removes a recurring source of review friction. No resourcing beyond that, and no roadmap item.
For engineering (talking points): Don't add this to composer.json — it's archived and unmaintained. Do this instead: run php artisan stub:publish, then diff the published stubs against this repo's versions to borrow the declare(strict_types=1), final, and explicit-return-type conventions. Adapt to our Pint/php-cs-fixer config and commit. Watch for three things: (1) Laravel has changed stub contents across majors, so start from our Laravel version's stubs rather than copying wholesale; (2) final by default breaks mocking and extension in tests — decide deliberately whether models, controllers, and migrations all get it, and document the exception path; (3) declare(strict_types=1) in generated files can surface latent type-coercion bugs elsewhere in the call path, so land it early in a release cycle with a green CI run rather than mid-freeze. Add a short note to the contributing guide so new scaffolds don't get hand-edited back to the old style.
How can I help you explore Laravel packages today?