Policies

Other topics

Creating Policies

Since defining all of the authorization logic in the AuthServiceProvider could become cumbersome in large applications, Laravel allows you to split your authorization logic into "Policy" classes. Policies are plain PHP classes that group authorization logic based on the resource they authorize.

You may generate a policy using the make:policy artisan command. The generated policy will be placed in the app/Policies directory:

php artisan make:policy PostPolicy

Contributors

Topic Id: 7344

Example Ids: 24375

This site is not affiliated with any of the contributors.