Examples of Policies (11)

Short information about policies

Policies are classes that organize authorization logic around a particular model or resource. For example, if your application is a blog, you may have a Post model and a corresponding PostPolicy class to authorize user actions such as creating or updating posts.
Read more in the official Laravel docs.

Repository: koel/koel (Github)
★ 12683 Created: Dec 2015 Updated: Jul 2021 Laravel version: 8
Files in the example:
- app/Policies/PlaylistPolicy.php
- app/Providers/AuthServiceProvider.php
- app/Http/Controllers/API/PlaylistController.php
Repository: laravelio/laravel.io (Github)
★ 1889 Created: May 2016 Updated: Jul 2021 Laravel version: 8
Files in the example:
- app/Policies/ArticlePolicy.php
- app/Http/Controllers/Admin/ArticlesController.php
- app/Models/User.php
Repository: iluminar/goodwork (Github)
★ 1622 Created: Nov 2017 Updated: Jul 2021 Laravel version: 8
Files in the example:
- app/Base/Policies/UserPolicy.php
- app/Base/Http/Controllers/MemberController.php
- app/Base/Providers/AuthServiceProvider.php
- app/Authorization/Authorization.php
Repository: guillaumebriday/laravel-blog (Github)
★ 1317 Created: Dec 2016 Updated: May 2021 Laravel version: 8
Files in the example:
- app/Policies/PostPolicy.php
- app/Http/Controllers/Api/V1/PostController.php
Repository: agorakit/agorakit (Github)
★ 332 Created: May 2016 Updated: Jun 2021 Laravel version: 8
Files in the example:
- app/Policies/CommentPolicy.php
- app/Http/Controllers/CommentController.php
Repository: realodix/urlhub (Github)
★ 242 Created: Aug 2018 Updated: Jul 2021 Laravel version: 8
Files in the example:
- app/Policies/UrlPolicy.php
- app/Providers/AuthServiceProvider.php
Repository: serversideup/financial-freedom (Github)
★ 88 Created: Mar 2021 Updated: Oct 2021 Laravel version: 8
Files in the example:
- app/Policies/TransactionPolicy.php
- app/Http/Controllers/Web/Transactions/TransactionsController.php
Repository: academico-sis/academico (Github)
★ 45 Created: Dec 2018 Updated: Aug 2021 Laravel version: 8
Files in the example:
- app/Providers/AuthServiceProvider.php
- app/Models/Policies/ContactPolicy.php
- app/Http/Controllers/ContactController.php
Repository: ammannbe/RecipeManager (Github)
★ 19 Created: Dec 2018 Updated: Feb 2021 Laravel version: 8
Files in the example:
- app/Policies/Ingredients/IngredientGroupPolicy.php
- app/Providers/AuthServiceProvider.php
- app/Http/Controllers/Ingredients/IngredientGroupController.php
Repository: devhub-az/devhub (Github)
★ 18 Created: Dec 2019 Updated: Jul 2021 Laravel version: 8
Files in the example:
- app/Policies/AuthorPolicy.php
- app/Providers/AuthServiceProvider.php
- app/Http/Controllers/Admin/UsersController.php
Repository: Melcus/parking-system (Github)
★ 1 Created: May 2021 Updated: Jul 2021 Laravel version: 8
Files in the example:
- app/Policies/ReservationPolicy.php
- app/Http/Requests/CalculatePaymentRequest.php

Additional resources on policies: