learn88/multirole

MultiRole & MultiUser for Laravel

v0.1.2 2017-06-22 17:18 UTC

This package is not auto-updated.

Last update: 2024-11-10 04:12:09 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

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.