limewell/laravel-make-extender
Supercharge Laravel's make commands: laravel-make-extender adds flags to make:model and friends so you can generate migrations, factories, seeders, form requests, controllers, and resources in a single command, with configurable paths, stubs, and defaults.
composer require --dev limewell/laravel-make-extender
Laravel package discovery registers the service provider automatically; confirm the new commands appear with php artisan list | grep make:.stubs/ directory — the stubs are the actual contract for what each generator produces, and they're what you'll customize first.php artisan make:helper to drop a function file into app/Helpers and have it autoloaded without manually editing composer.json. This is the package's highest-value feature — the other generators mostly save a copy/paste.php artisan vendor:publish --provider="Limewell\...ServiceProvider" or the tagged variant shown in the README) so your team's conventions live in-repo rather than in vendor/.Helpers. Generate one file per concern (StringHelper, ArrayHelper) rather than a single god-helper. Because the package handles autoloading, the workflow is "generate → write functions → call them anywhere." Keep them pure and stateless so they stay testable without bootstrapping Laravel.
Service classes. Use make:service for orchestration that doesn't belong in a controller or model — third-party API wrappers, multi-step domain operations. Then bind them in a service provider and inject via constructor. Treat the generated class as a blank canvas; the package gives you the file, you give it the contract (an interface + binding) so it's mockable in tests.
Builder scopes. Generate the scope, implement Scope, then apply locally (->scoped(FooScope::class) per query) or globally in the model's booted() method. This is the correct home for reusable query fragments that would otherwise become model bloat or magic string scopes.
Traits. Use for cross-model concerns (slugging, soft-delete-adjacent behavior, activity logging). Generate into a sensible namespace (App\Models\Concerns) and keep them free of hard-coded model assumptions.
Custom casts. One cast per file, implementing CastsAttributes. Best used for value objects (Money, Email, Coordinates) so the rest of the app never sees raw strings.
Collection macros. Register in a dedicated service provider's boot(), guarded appropriately so they aren't redefined on repeated boots (notably in long-running workers or parallel tests). Keep macro bodies small — they're hard to discover via IDE.
View composers. Generate the composer, then register it in a service provider via View::composer('dashboard.*', DashboardComposer::class). Prefer class-based composers over closures so they're testable.
Stub customization as a workflow pattern. Publish stubs, add your project's namespace, license header, strict types, and declare(strict_types=1). Every developer on the team then generates consistent files regardless of who runs the command.
composer.json files entries or a provider that requires the directory. After generating your first helper, if the function is undefined, run composer dump-autoload and re-check. Never assume generating = immediately callable everywhere.make:cast, make:scope, make:observer, etc. If your Laravel version already has a command the package also registers, behavior depends on registration order — verify which one wins with php artisan list before relying on the package's output shape.require-dev. Nothing in production should reference the package namespace.composer.json, and smoke-test generators after any Laravel upgrade — minor Laravel internals changes can silently break make command signatures before the package catches up.boot(), not in register(), and reset global scopes in tearDown() when using them.-vvv. Most failures are stub-not-found or namespace resolution issues — check that the stubs directory is published/wired correctly.How can I help you explore Laravel packages today?