Artisan commands to Laravel apps that utilizes Domain Driven Design. Based on notiv/laravel-domain-commands
jair921/laravel-domain-commands is a Laravel package for artisan commands to laravel apps that utilizes domain driven design. based on notiv/laravel-domain-commands.
It currently has 0 GitHub stars and 8 downloads on Packagist (latest version 0.0.2).
Install it with composer require jair921/laravel-domain-commands.
Discover more Laravel packages by jair921
or browse all Laravel packages to compare alternatives.
Last updated
composer require jair921/laravel-domain-commands
You can publish config, if you want
php artisan vendor:publish --tag="domain-commands-config"
make:model <domain:model>
Create a new Eloquent model class
Example: php artisan make:model User:User
Options:
--force Create the class even if the model already exists-a, --all Generate a migration, seeder & factory for the model-f, --factory Create a new factory for the model-m, --migration Create a new migration file for the model-s, --seed Create a new seeder file for the model-p, --pivot Indicates if the generated model should be a custom intermediate table modelmake:action <domain:action>
Create an action for a given domain
Example: php artisan make:action User:CreateUserAction
make:dto <domain:dto>
Create a dto for a given domain
Example: php artisan make:dto User:CreateUserDTO
You should install https://github.com/spatie/data-transfer-object for convenience
Options:
-r, --request DTO file with static fromRequest methodmake:cast <domain:cast>
Create a new custom Eloquent cast class
Example: php artisan make:cast User:JsonCast
make:collection <domain:collection>
Create a collection for a given domain
Example: php artisan make:collection User:UserCollection
make:event <domain:event>
Create a new event class
Example: php artisan make:event User:UserCreatedEvent
make:enum <domain:enum>
Create an enum for a given domain
Example: php artisan make:enum User:UserColorEnum
make:listener <domain:listener>
Create a new event listener class
Example: php artisan make:listener User:SendSlackMessage -e User:UserCreatedEvent --queued
Options:
--queued Indicates the event listener should be queued-e, --event=<domain:event> The event class being listened formake:observer <domain:observer>
Create a new observer class
Example: php artisan make:observer User:UserObserver -m User:User
Options:
-m, --model=<domain:model> The model that the observer applies tomake:policy <domain:policy>
Create a new policy class
Example: php artisan make:policy User:UserPolicy -m User:Post
Options:
-m, --model=<domain:model> The model that the policy applies to-g, --guard=<domain:model> The guard that the policy relies onmake:query-builder <domain:query-builder>
Create a query builder for a given domain
Example: php artisan make:query-builder User:UserQueryBuilder
make:rule <domain:rule>
Create a new validation rule
Example: php artisan make:rule User:PasswordMinlengthRule
Options:
-i, --implicit Generate an implicit rulemake:controller <domain:controller>
Create a new controller class
Example: php artisan make:controller User:UserController
Options:
--force Create the class even if the controller already exists--api Exclude the create and edit methods from the controller-i, --invokable Generate a single method, invokable controller class-m <domain:model>, --model=<domain:model> Generate a resource controller for the given model-p <domain:model>, --parent=<domain:model> Generate a nested resource controller class-r, --resource Generate a resource controller classmake:request <domain:request>
Create a new form request class
Example: php artisan make:request User:LoginRequest
make:job <domain:job>
Create a new job class
Example: php artisan make:job User:SendMessageJob
Options:
--sync Indicates that job should be synchronousmake:mail <domain:mail>
Create a new email class
Example: php artisan make:mail User:WelcomeUser
Options:
-f, --force Create the class even if the mailable already exists-m, --markdown[=MARKDOWN] Create a new Markdown template for the mailablemake:notification <domain:notification>
Create a new notification class
Example: php artisan make:notification User:InvoicePaid
Options:
-f, --force Create the class even if the notification already exists-m, --markdown[=MARKDOWN] Create a new Markdown template for the notificationmake:middleware <domain:middleware>
Create a new middleware class
Example: php artisan make:middleware User:AuthMiddleware
make:resource <domain:resource>
Create a new resource class
Example: php artisan make:resource User:UserResource
Options:
-c, --collection Create a resource collectionmake:component <domain:component>
Create a new view component class
Example: php artisan make:component User:UserComponent
Options:
--force Create the class even if the component already exists--inline Create a component that renders an inline viewmake:view-model <domain:view-model>
Create a view-model for a given app
Example: php artisan make:view-model User:UsersViewModel
make:factory <domain:factory>
Create a new model factory
Example: php artisan make:factory UserFactory
Options:
-m <domain:model>, --model=<domain:model> Bind factory to the modelmake:model --auth ?make:state [domain:name] https://stitcher.io/blog/laravel-beyond-crud-05-statesmake:{http query builder} [app:name]