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,
],
Command:
php artisan make:multirole
composer dump-autoload
required : database
php artisan migrate
php artisan db:seed
username : admin@learn88.dev
password : password
Route::get('users}', [
'uses' => 'UserCtrl@index',
'as' => 'users.show',
'middleware'=>'roles', // route middleware check role
'roles'=>['role_admin'] // allow role name ['role_name' , 'etc..']
]);
The MIT License (MIT). Please see License File for more information.