Laravel Extended Commands
Additional Artisan generators for actions, Eloquent builders and collections.
Screenshots
About Laravel Extended Commands
Laravel Extended Commands is Punyapal Shah's collection of additional Artisan generators and development commands. It is intended for Laravel projects that repeatedly create structures beyond the framework's default scaffolding. The repository documents generators for custom builders, collections and actions, among other related workflows.
The appeal is consistency. When several developers create the same kind of class, a generator can establish the expected namespace, base class and method shape. That leaves the review focused on behaviour rather than correcting slightly different versions of boilerplate in every pull request.
Generators should express a convention
A custom action class is useful when the project has a clear convention for application operations. A custom Eloquent builder is useful when query behaviour belongs with a model's query interface. A custom collection is useful when operations apply to a set of models. Generating those classes makes sense after the team agrees where each responsibility belongs.
Without that agreement, more generators can simply produce more places to hide logic. Before adopting the package, identify the structures your application actually uses and document a small example of each. A generator should make an existing convention easier to follow rather than become the reason for introducing an unnecessary layer.
The package's action generator uses a handle method, which fits a common Laravel application pattern. The class can then hold one operation and accept explicit inputs. Validation and authorisation still belong at the appropriate boundaries, and a generated action should not become a catch-all container for unrelated application behaviour.
Custom Eloquent builders
The documented builder generator can create a builder directly or associate it with a model. That is relevant when a model has a coherent set of reusable query methods that deserve names and type information. Examples might include selecting records ready for a particular workflow or applying a domain-specific filter.
Keep those methods about querying. A builder method that sends notifications, charges a customer or writes unrelated records will surprise callers who expect it to describe a database selection. The generator establishes a class; the application still needs to preserve the expectations of the abstraction it extends.
After generation, inspect the model integration and return types. Static analysis should understand which model the builder operates on and which builder type a method returns. A fluent interface becomes much easier to use when the editor and analysis tools can follow it without broad mixed types.
Custom collections
The collection generator creates a class based on Eloquent's collection, with options for model-related generic documentation. The README also describes scaffolding a model together with a custom collection and connecting the model's collection creation method. This is useful when a group of models has operations that are meaningful as a group.
Choose those operations carefully. A collection method that calculates a total or groups records for a report can make a caller clearer. A method that quietly performs many external writes deserves a more explicit application action. The class name should help a reviewer predict whether a call transforms data, queries data or changes the outside world.
Test the generated model path as well as constructing the collection manually. The real value is that ordinary model queries return the intended collection type. If the connection between model and collection is missing, a standalone collection test can pass while application callers still receive the default type.
Review generated code like handwritten code
Scaffolding is a starting point. Read the files before committing them, remove unused imports and fill in the actual types and behaviour. A generated class with an empty method is not an implemented feature. Keep the final diff small enough that another maintainer can see why the class exists.
The same discipline applies when a generator modifies an existing model. Check the diff for changes to imports, methods and type declarations, especially in a model with existing customisations. Run formatting and static analysis as part of the normal project checks. Generated code should meet the same standards as the surrounding codebase.
If the team customises its conventions later, update the scaffolding process deliberately. Old and new classes should remain understandable together. A gradual change is often easier to maintain than a project where each developer has a different local template that produces a subtly different architecture.
Installation and compatibility
The package is available through Composer under Punyapal's vendor name. The current repository manifest includes Laravel 11, 12 and 13 constraints and requires a modern PHP version. Review the version being installed and its dependency resolution in your project, rather than assuming default-branch compatibility describes every historical release.
The repository also documents integration guidance for Laravel Boost. That guidance can help an assistant discover the package's intended generator workflow, but it does not replace reviewing the resulting code. The repository remains the authoritative place to check available commands and their options for the release in use.
Laravel Extended Commands is a good fit when repeated scaffolding is a real source of inconsistency. It offers less value when a project only creates one unusual class and will never repeat the pattern. Use the tool to make established Laravel conventions easier to apply, and keep the final code simple enough that contributors do not need the generator installed merely to understand it.
Sources: Laravel Extended Commands repository, Composer package, and Punyapal Shah's open-source work. The image is an original editorial package card.
Reviews
Used Laravel Extended Commands? Share your experience.
Log in to reviewNo reviews yet
Used it? Be the first to leave a rating.