learn88 / multirole
MultiRole & MultiUser for Laravel
v0.1.2
2017-06-22 17:18 UTC
Requires
- php: ~5.6|~7.0
- illuminate/support: ~5.1
Requires (Dev)
- phpunit/phpunit: ~4.0||~5.0||~6.0
- squizlabs/php_codesniffer: ^2.3
This package is not auto-updated.
Last update: 2024-11-10 04:12:09 UTC
README
Install
Via Composer
$ composer require learn88/multirole
Next, add your new Provider
to the providers array of config/app.php:
'providers' => [ learn88\multirole\multiroleServiceProvider::class, ],
Next, add your new Kernel
to the HTTP kernel
$routeMiddleware
protected $routeMiddleware = [ 'roles' => \learn88\multirole\Http\Middleware\CheckRole::class, ],
New
Command:
php artisan make:multirole
composer dump-autoload
required : database
php artisan migrate
php artisan db:seed
Default
username : admin@learn88.dev
password : password
Usage
Route::get('users}', [ 'uses' => 'UserCtrl@index', 'as' => 'users.show', 'middleware'=>'roles', // route middleware check role 'roles'=>['role_admin'] // allow role name ['role_name' , 'etc..'] ]);
License
The MIT License (MIT). Please see License File for more information.