dev-master
9999999-dev https://emilmoe.com/guardianMiddleware based permission control
MIT
The Requires
- illuminate/support ~5.1
- php ~5.5|~7.0
The Development Requires
by Emil Moe
guardian saas permission emilmoe
Wallogit.com
2017 © Pedro Peláez
Middleware based permission control
![Software License][ico-license]
![Coverage Status][ico-scrutinizer]
![Total Downloads][ico-downloads], (*1)
Guardian is a framework for handling roles and permissions in Laravel. As SaaS and management web application are being more and more popular, it's essential to make the flow of the permissions as simple as possible, so you can focus on making the product., (*2)
Therefor I made this package which will enable you to define permissions in middleware. Not only does this allow you to separate the logic from your application it also allows you to perform php artisan route:list to see which part of your application is restricted by which permission., (*3)
Guardian requires Laravel 5.1 in order to work due to it's use of middleware parameters. Other requirements are defined by Laravel 5.1., (*4)
The easiest way to install Guardian is to use composer. Run this composer in your shell to begin installation, (*5)
composer require emilmoe/guardian
After the package has successfully been installed to your application, you must set up a service provider in config\app.php:, (*6)
EmilMoe\Guardian\GuardianServiceProvider::class,
Publish the migrations and configuration files to your application by executing this command in your shell:, (*7)
php artisan vendor:publish --provider="EmilMoe\GuardianServiceProvider"
Please take a look through the config fil in config\guardian.php as some configurations must be set before you migrate the package. The configurations is sefl explainable., (*8)
Last step is to migrate 4 tables to your database. Guardian currently only supports application with an database, the tables are used to keep track of roles, permissions and how they are related between and with your application., (*9)
Run the migration by executing this in your shell:, (*10)
php artisan migrate
In your user model, which by default is App\User.php you must add this trait:, (*11)
use WithPermission;
Read more about the traits in the trait section, but it's essential for Guardian to work., (*12)
See http://emilmoe.com/guardian/, (*13)
Please see CHANGELOG for more information what has changed recently., (*14)
Coming, (*15)
Please see CONTRIBUTING and CONDUCT for details., (*16)
If you discover any security related issues, please email emil@moegroup.dk instead of using the issue tracker., (*17)
The MIT License (MIT). Please see License File for more information., (*18)
Middleware based permission control
MIT
guardian saas permission emilmoe