Download the PHP package mashyindustries/laraccess without Composer
On this page you can find all versions of the php package mashyindustries/laraccess. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mashyindustries/laraccess
More information about mashyindustries/laraccess
Files in mashyindustries/laraccess
Package laraccess
Short Description Roles, Inheritence & Permissions for Laravel 5.4
License MIT
Informations about the package laraccess
Laraccess - User Roles & Role Inheritance
Works with Laravel 5.4
This package allows to save roles in a database. Roles can inherit other roles too.
It includes blade directives & middleware
Install
You can install the package via composer:
This service provider must be installed.
You can publish the migration with:
The package assumes that your users table name is called "users". If this is not the case you should manually edit the published migration to use your custom table name.
After the migration has been published you can create the role tables with:
You can publish the config-file with:
Usage
First add the Mashy\Laraccess\Traits\HasRoles
trait to your User model.
This package allows for users to be associated with roles.
You can create roles with:
The HasRoles
adds collections to your models.
Using Roles
A role can be assigned to a user:
A role can be removed from a user:
Roles can also be synced :
You can determine if a user has a certain role:
You can also determine if a user has any of a given list of roles:
You can also determine if a user has all of a given list of roles:
Using blade directives
This package also adds Blade directives to verify whether the currently logged in user has all or any of a given list of roles.
You can use Laravel's native @can
directive to check if a user has a certain permission.
Using a middleware
Information coming soon...
Inheritance
Information coming soon...
Credits
This package was based on Spatie/Laravel-Permission