SparkRoles, based on Caffeinated Shinobi, brings a simple and light-weight role-based permissions system to Laravel Spark's Team and User models through the following ACL structure:
Permissions are then inherited to the team/user through the team/user's assigned roles.
This package is a replacement for Caffeinated Shinobi when building a project based on Laravel/Spark.
You will find user friendly documentation in the ZiNETHQ SparkRoles Wiki BEING UPDATED
Install the package through Composer.
composer require zinethq/spark-roles:dev-master
Add the service provider to your project's config/app.php file.
Publish the configuration, models, and migrations into your project.
php artisan vendor:publish --provider="ZiNETHQ\SparkRoles\SparkRolesServiceProvider"
Migrate your database.
php artisan migrate
Add the CanUseRoles trait to your Team and/or User models, for example:
use Laravel\Spark\Team as SparkTeam;
class Team extends SparkTeam
use Laravel\Spark\User as SparkUser;
class User extends SparkUser
Optional: If you'd like to dynamically assign the Spark developer array based on team/user roles then open app\Http\kernel.php and add the following to the web middleware group:
This middleware can be controlled (enabled/disabled and choose the role slug that identifies developers) in the package's configuration file.
Start using roles for your Spark teams and users!
Fork, edit, pull request. You know the drill.
If you'd like to contribute consider helping with one of the following:
Caffeinated Shinobi is an awesome tool for Laravel that adds Role Based Access Control (RBAC) to your user model. There is also a cool UI for Shinobi called Watchtower. Go take a look!