User manager with roles (single and multiple)
composer require gertjanroke/users
Add the following line to "config/app.php"
at "providers":
Gertjanroke\Users\UsersServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
And at "aliases":
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
Run the following command:
php artisan vendor:publish
Run the command:
php artisan migrate
Add the following lines to the '$routeMiddleware' array in the file 'App/Http/Kernel.php'
'onlyAdmin' => \Gertjanroke\Users\Http\Middleware\IfAdmin::class,
If you go to the user index you first need a role that sign in the config file
If you want to at basic roles, do the following thinks.
Add to your 'DatabaseSeeder.php' file in the 'database/seeds' folder
$this->call(RoleTableSeeder::class);
$this->call(RoleUserTableSeeder::class);
After that run the next command:
php artisan db:seed
####### Or if you don't want to do that run the following commands:
first: php artisan db:seed --class=RoleTableSeeder
second: php artisan db:seed --class=RoleUserTableSeeder