-
Notifications
You must be signed in to change notification settings - Fork 0
Console
The package adds 4 console commands for generating actions and responders.
All commands use configuration for resolving placement of the generated classes.
Running php artisan make:adr:action MyAwesomeAction will create new MyAwesomeAction class in proper directory.
Command takes one argument:
-
name- action's class name.
Command takes two options:
-
-ror--responder- flag to generate responder class along with the action class (giving example above,MyAwesomeActionResponderclass will be generated in proper directory; action class will have$responderClassproperty automatically set), -
-tor--responder_type- flag to indicate responder's type:plainorextended.
Running php artisan make:adr:action_resource Users will create resource-like actions (5 or 7). All classes will be generated in proper directory.
Command takes one argument:
-
name- resource name (with namespace).
Command takes four options:
-
-aor--api- flag to generate API-like resource actions -
-ror--responder- flag to generate responder classes along with actions (it will behave in the same way as command above, i.e. generate set or responders and bind them with controller via class property), -
-tor--responder_type- flag to indicate responders type:plainorextended, -
-oor--only- flag to set which resource type to generate (similar to route options), -
-eor--except- flag to set which resource type not to generate (similar to route options).
php artisan make:adr:action_resource Users -r -a
will generate 5 action classes and 5 responders classes:
-
DestroyUserAction,IndexUsersAction,ShowUserAction,StoreUserAction,UpdateUserAction, -
DestroyUserActionResponder,IndexUsersActionResponder,ShowUserActionResponder,StoreUserActionResponder,UpdateUserActionResponder.
Running php artisan make:adr:responder MyAwesomeActionResponder will create new MyAwesomeActionResponder class in proper directory.
Command takes one argument:
-
name- responder's class name.
Command takes one option:
-
-tor--type- flag to indicate responder's type:plainorextended.
Running php artisan make:adr:responder_resource Users will create resource-like responders (5 or 7). All classes will be generated in proper directory.
Command takes one argument:
-
name- resource name (with namespace).
Command takes three options:
-
-aor--api- flag to generate API-like resource responders -
-tor--type- flag to indicate responders type:plainorextended, -
-oor--only- flag to set which resource type to generate (similar to route options), -
-eor--except- flag to set which resource type not to generate (similar to route options).
-
2.1. ADR
-
3.1. Conventions
3.2. Action & Routing
3.3. Responder
3.5. Exceptions
3.6. Console
3.7. Examples