Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Strict Stubs

Laravel Strict Stubs Laravel Package

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.

View on GitHub
Deep Wiki
Context7

mll-lab/laravel-strict-stubs replaces Laravel's default generator stubs with strict, opinionated templates, so every class you scaffold with make: commands starts out typed, final, and ready for static analysis instead of needing manual cleanup.

Publish the stubs and Laravel's generators pick them up automatically—no changes to your workflow. Generated controllers, models, jobs, and other artifacts come with declare(strict_types=1), consistent formatting, and your project's conventions baked in from the first line.

  • Ships strict-typed stubs for common artisan make: commands
  • Adds declare(strict_types=1) and final where sensible
  • Publishable and customizable per project
  • Drop-in: no generator overrides required
Frequently asked questions about Laravel Strict Stubs
What is mll-lab/laravel-strict-stubs used for?
It provides stricter replacements for Laravel's default Artisan generator stubs, including declare(strict_types=1) and opinionated defaults. The goal is to make newly generated PHP files start with stronger typing and consistent formatting. Existing application files are not rewritten by the package.
How do I install mll-lab/laravel-strict-stubs in a Laravel app?
Install it with Composer using composer require mll-lab/laravel-strict-stubs. Then publish the package stubs if your setup requires local customization, typically through php artisan vendor:publish. Because it follows Laravel package conventions, verify the published paths and generated output in a branch before rolling out.
Which Laravel versions are supported by laravel-strict-stubs?
The provided package context does not document explicit Laravel version constraints, so check the repository composer.json and README before adopting it. Test the package against your project's Laravel and PHP versions in a non-production branch. Confirm that Artisan generation and stub publishing work for the specific Laravel release you use.
Does laravel-strict-stubs add declare(strict_types=1) to generated files?
Yes, adding strict typing is the package's main purpose, so newly generated PHP files should include declare(strict_types=1) where the replaced stub applies it. It also applies other opinionated defaults for consistency. The package affects generation-time stubs, not files that already exist in your codebase.
Does the package override Laravel's default generator stubs or add new ones?
It supplies replacement stubs for Laravel's default generator stubs, so generation uses the package's stricter stub content instead of Laravel's defaults. This is a development-time customization and does not change Laravel runtime behavior. Review the package service provider and vendor:publish output to confirm exactly which stub paths are overridden in your app.
Is the v2.0.1 release a breaking change?
No, v2.0.1 is described as a non-functional code style change that aligns brace formatting in migration stubs with php-cs-fixer codestyle. It does not introduce breaking changes, new features, or deprecations according to the assessment. You should still run your normal tests after upgrading if you depend on published stub output.
Can I use laravel-strict-stubs with php-cs-fixer?
Yes, the v2.0.1 release specifically aligns migration stub brace formatting with php-cs-fixer codestyle. That makes it a better fit for teams that already enforce php-cs-fixer rules on generated files. You should still run php-cs-fixer after generation to confirm your project rules are satisfied.
Does laravel-strict-stubs affect production runtime or performance?
No, generator stubs are used at development time when Artisan creates files, not during request handling or production runtime. The package should have negligible scaling impact and no production performance effect. Its main production concern is the style and strictness of code you generate and commit.
How should I test laravel-strict-stubs before rolling it out?
Install it in a non-production branch, publish stubs if needed, and generate sample files with the Artisan commands your team uses. Confirm the output includes strict typing and matches your formatting rules, then run your test suite. Also check for stub conflicts with Laravel defaults or other packages that publish the same paths before moving to development and production.
Is laravel-strict-stubs maintained, and what are alternatives for custom stubs?
The available assessment notes sparse release history and no confirmed long-term maintenance cadence, so review recent repository activity and test after Laravel upgrades. For custom needs, you can maintain local stub overrides using Laravel's stub publishing and customization features instead of this package. If you use this package alongside custom stubs, document the diff and update your internal style guide.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager