This repository was archived by the owner on Apr 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
PolicyMakeCommand
Ferdinand Frank edited this page Feb 19, 2017
·
2 revisions
Creates a new policy class. Also inserts an entry for the policy in the $policies array of the application's AuthServiceProvider (as specified in the config file) when option -m, --model[=MODEL] is provided.
php artisan make:policy [options] [--] <name>
| Argument | Description | Note |
|---|---|---|
| name | The name of the class | Required |
| Option | Description | Default |
|---|---|---|
| -m, --model[=MODEL] | The model that the policy applies to | |
| -h, --help | Display a help message | |
| -q, --quiet | Do not output any message | |
| -V, --version | Display this application version | |
| --ansi | Force ANSI output | |
| --no-ansi | Disable ANSI output | |
| -n, --no-interaction | Do not ask any interactive question | |
| --env[=ENV] | The environment the command should run under | |
| -v|vv|vvv, --verbose | Increase the verbosity of messages |
This table gives you an overview when which stub file is used as a template to create the php file.
| Stub | Command Restriction |
|---|---|
| policy.stub | Used when option -m, --model[=MODEL] is provided |
| policy.plain.stub | Used when none of the above options is provided |