Download the PHP package untitledpng/laravel-policy-roles without Composer
On this page you can find all versions of the php package untitledpng/laravel-policy-roles. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download untitledpng/laravel-policy-roles
More information about untitledpng/laravel-policy-roles
Files in untitledpng/laravel-policy-roles
Download untitledpng/laravel-policy-roles
More information about untitledpng/laravel-policy-roles
Files in untitledpng/laravel-policy-roles
Vendor untitledpng
Package laravel-policy-roles
Short Description Add multiple roles to a user and handle their policies
License
Package laravel-policy-roles
Short Description Add multiple roles to a user and handle their policies
License
Please rate this library. Is it a good library?
Informations about the package laravel-policy-roles
laravel-policy-roles
With this package you can have role based permissions. When the role does not exist, this package will automatically prevent access. This package also supports Laravel Nova out of the box.
Installation
Install the package using composer composer require untitledpng/laravel-policy-roles
.
How to use this package
- First you have to extend your user eloquent model with
Untitledpng\LaravelPolicyRoles\Domain\User
. - Create a new policy like the example policy below.
- Now add the policy to the
AuthServiceProvider
like you normally would. - Add Roles and Permissions to your database.
- Done!
Example policy
Extra features
- It is possible to use
$user->hasRole('view-user');
This will return true/ false based on if the user has that role. - Usage of a special helper
@can('create', App\User::class) YES @endcan
to check if the user has a specific permission.
All versions of laravel-policy-roles with dependencies
PHP Build Version
Package Version
The package untitledpng/laravel-policy-roles contains the following files
Loading the files please wait ....