Download the PHP package livelyworks/laravel-yes-authority without Composer
On this page you can find all versions of the php package livelyworks/laravel-yes-authority. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download livelyworks/laravel-yes-authority
More information about livelyworks/laravel-yes-authority
Files in livelyworks/laravel-yes-authority
Package laravel-yes-authority
Short Description YesAuthority - Laravel Routes Authorization Library
License MIT
Informations about the package laravel-yes-authority
YesAuthority
YesAuthority is flexible authorization system for Laravel, It checks the route
permission to access a certain portion of the site or application. To add Permissions User-based
, Role-based
, Conditionally
. It uses authority.checkpost
middleware for filter permission of current accessing route, Under this middleware checked every permission of the user login.
Installation
Require this package in your composer.json
or install it by running:
Now, insert this line into your config/app.php
under the provider
array.
Now, run this command after that config/yes-authority.php
and app/Http/Middleware/YesAuthorityCheckpostMiddleware.php
files are publish.
Now, insert this line into your app/Http/Kernel.php
under the $routeMiddleware
array.
Use authority.checkpost
middleware for handle permission base routes.
Now, the basic setup is ready you need to configure rules of permissions using config/yes-authority
.
Configuration
The structure of permissions given below, but it's highly recommended to read more on docs`.
Usage - Helpers
-
canAccess($accessId = null);
Check the access, By default it check current route and return response in boolean value. canPublicAccess($accessId = null); -
Check the public access, By default it check current route and return response in boolean value.Authentication not required
Usage - Facade
-
YesAuthority::check($accessId = null, $requestForUserId = null)
Check the access of$accessId
, By default it check current route and return response in boolean value, And it can check access of perticular user by passing user id($requestForUserId)
parameter. YesAuthority::isPublicAccess($accessId = null); -
Check the access ofAuthentication not required
$accessId
, By default it check current route and return response in boolean value.
Usage - Directives
-
@canAccess($accessId = null);
Check the access, By default it check current route and return response in boolean value. @canPublicAccess($accessId = null); -
Check the public access, By default it check current route and return response in boolean value.Authentication not required