muhbayu/larapriv

Simple Privilege Roles

dev-master 2019-04-16 10:30 UTC

This package is auto-updated.

Last update: 2024-11-16 23:08:48 UTC


README

Simple Privileges Roles for Laravel

Installation

This package can be used in Laravel 5.7 or higher.

You can install the package via composer:

composer require muhbayu/larapriv

In Laravel 5.5 or higher the service provider will automatically get registered. In older versions of the framework just add the service provider in config/app.php file:

'providers' => [
    // ...
	MuhBayu\LaraPriv\LaraPrivServiceProvider::class,
];

You can publish Provider:

php artisan vendor:publish --provider="MuhBayu\LaraPriv\LaraPrivServiceProvider"

After the migration has been published you can create the privilege role- and permission-tables by running the migrations:

php artisan migrate

Then, in app/Http/Kernel.php, register the middlewares:

protected $routeMiddleware = [
    // ...
	'privileges.roles' => \MuhBayu\LaraPriv\Middleware\RolesPermission::class,
];

Documentation

Coming soon