Commands.app

php artisan make:policy

Code Generation

Create a new policy class

Options & Flags
Available options for this command
--model=Model

The model that the policy applies to

Examples
Common usage examples

Create a policy

php artisan make:policy PostPolicy

Create policy for specific model

php artisan make:policy PostPolicy --model=Post
Notes
  • Policies organize authorization logic
  • Use gates and policies for authorization
Related Commands
You might also find these useful