Download the PHP package cosmos/rbac without Composer
On this page you can find all versions of the php package cosmos/rbac. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package rbac
Short Description A trait for using Role-based access control in the User that a Laravel eloquent model.
License MIT
Informations about the package rbac
Role Based Access Control
A trait for using Role-based access control in the User that a Laravel eloquent model.
WHAT IS RBAC
Role-based access control (RBAC) is an approach to restricting system access to authorized users. See below for details.
Table of contents
- Database Structure
- Installation
- Models
- User
- Role
- Permission
- Usage
- Assigning Roles and Permissions
- Using Middleware
- Using Blade Directives
- License
Database Structure
Installation
Install package via composer
The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php
file:
You can add middleware inside your app/Http/Kernel.php
file:
You should publish the config/rbac.php
config file:
Models
User
Add the Cosmos\Rbac\RoleBasedAccessControl
trait to your App\User
model:
Role
Extends the Cosmos\Rbac\Role
to your App\Role
model:
Permission
Extends the Cosmos\Rbac\Permission
to your App\Permission
model:
Usage
Assigning Roles and Permissions
You can assign editor
role to the specific user.
And also you can deny roles from the user.
Using Middleware
Using middleware rules in routes
Using middleware rules in Controllers
Using Blade Directives
Check for a specific role:
or permissions
License
The MIT License
All versions of rbac with dependencies
illuminate/auth Version ^6.0
illuminate/container Version ^6.0
illuminate/contracts Version ^6.0
illuminate/database Version ^6.0
chelout/laravel-relationship-events Version ^1.1