Download the PHP package sergmoro1/laravel-rbac without Composer
On this page you can find all versions of the php package sergmoro1/laravel-rbac. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sergmoro1/laravel-rbac
More information about sergmoro1/laravel-rbac
Files in sergmoro1/laravel-rbac
Package laravel-rbac
Short Description Role Based Access Control (RBAC) for Laravel based on Yii3 package
License MIT
Informations about the package laravel-rbac
Laravel RBAC
This package adapts Yii Role-Based Access Control with PHP storage to Laravel.
Installation
Publish RBAC sample
After sample publishing the class App\Concole\Commands\Rbac
can be used as the basis of your own access system.
Bind AccessCheckerInterface
with its implimentation
Make changes to the file App\Providers\AppServiceProvider
.
RBAC init
Before executing the command below, edit the assignment of roles to users in the class App\Console\Commands\Rbac
.
Example
The example implies that you have a Post
model defined. The author can add posts and edit only his own. The administrator can also add posts, but can edit all. Make some changes to the classes below.
User
model
Controller
PostController
Rules
Pay attention composite rule used in a Rbac command.
In this way, complex rules for verifying the rights to perform actions can be set.
All versions of laravel-rbac with dependencies
illuminate/support Version ^10.0|^11.0
yiisoft/rbac Version ^2.0
yiisoft/rbac-php Version ^2.0
yiisoft/rbac-rules-container Version ^2.1