Askedio / Laravel5-RBAC

User Roles & Permissions for Laravel 5.2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel5-RBAC

User Roles & Permissions for Laravel 5.2

Overview

This Package glues together laravel-permission and laravel-authorize to be one package giving you all the features and a simple install command to easily get started.

More details here:

Installation

Install with composer

composer require askedio/laravel5-rbac:dev-master

Add to Providers array in config/app.php

'providers' => [
   Askedio\Laravel5RBAC\Providers\GenericServiceProvider::class,
   ...

Change your config/auth.php providers->users->model

    'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => Askedio\Laravel5RBAC\User::class,
        ],
        ...

Set up auth views and migrations

php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider" --tag="migrations"
php artisan make:auth
php artisan migrate 

Install the role and user

php artisan user:create

Serv

php artisan serv

Use in routes

Route::get('dashboard', [
   'middleware'=> ['web','can:admin'],
   'uses' => 'HomeController@index',
]);

About

User Roles & Permissions for Laravel 5.2

License:MIT License


Languages

Language:PHP 100.0%