Download the PHP package nagy/permissions-handler without Composer
On this page you can find all versions of the php package nagy/permissions-handler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package permissions-handler
Permissions Handler
Permissions-handler is an easy-to-use package for laravel 5 to manage users roles and permissions in an easy and attractive way
Features
Caching
Permissions Handler uses the caching feature on two levels
- Database Cache:
Permissions Handler uses the cache driver that configured in yourcache.php
file for caching user permissions, roles for configurable time. - Annotation Cache:
Because of parsing the files against the annotations is costy; permission Hander caches the parsed annotations to avoid parsing it again. by default this features is disabled in the development environment and enabled in the production.
Gate Integration
PermissionsHandler register users permissions into the Gate
, so you can easly use laravel built in can
method.
Guard Support
PermissionsHandler doesn't depend on a specific model or guard, you can use whatever models or guards you need, PermissionsHandler will handle all.
Seeder
If you enabled the seeder
option from the config/permissionsHandler.php
file then Permissions Handler will save each created permission, role and role-permissions to fils to be able to seed it again in later time or share them with others.
Annotations
PermissionsHandler comes with an optinal awesome feature Annotations, it is based on Doctrine\Annotations. you can use it as the following:
As the above example, Permissions Handler comes with three types of annotations.
Permissions({"perm1"})
:
only users that have perm1 permission can access this methodRoles({"role1"})
:
only users that have role1 role can access this method-
Owns(relation="posts", parameter="id")
:
for example, if you are the owner of the post then only you whose can edit this post.Owns
will ensure that, just pass the relation and the parameter which PermissionsHandler will get the value from the Request accordingly.Check the usage section for more features and details
License
Thanks to Ahmed Sorour <3