https://github.com/dillingham/optional-policy
Make policies optional in controllers / authorize method
https://github.com/dillingham/optional-policy
laravel
Last synced: about 2 months ago
JSON representation
Make policies optional in controllers / authorize method
- Host: GitHub
- URL: https://github.com/dillingham/optional-policy
- Owner: dillingham
- License: mit
- Created: 2019-08-24T05:13:04.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-07T20:30:11.000Z (almost 7 years ago)
- Last Synced: 2025-03-31T20:13:45.466Z (over 1 year ago)
- Topics: laravel
- Language: PHP
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# optional policy
[](https://packagist.org/packages/dillingham/optional-policy)
[](https://packagist.org/packages/dillingham/optional-policy) [](https://twitter.com/dillinghammm)
allows packages to call `authorize()` without knowing policy exists
basically allows package consumers to hook into authorization
```
composer require dillingham/optional-policy
```
change `AuthorizesRequests` to `OptionallyAuthorizesRequests`