php artisan make:policy
Code GenerationCreate a new policy class
Options & Flags
Available options for this command
--model=ModelThe model that the policy applies to
Examples
Common usage examples
Create a policy
php artisan make:policy PostPolicyCreate policy for specific model
php artisan make:policy PostPolicy --model=PostNotes
- Policies organize authorization logic
- Use gates and policies for authorization
Related Commands
You might also find these useful