Skip to content

oncloud/laragate

Repository files navigation

Laragate

Laragate is a simple package to help you to create a simple permission system for your Laravel App.

Installation

You can install the package via composer:

composer require lectero/laragate

Usage

1. Publish the config file

php artisan vendor:publish --provider="Lectero\Laragate\LaragateServiceProvider"

2. Create a new permission

php artisan make:permission "permission name"

3. Add the trait to your User model

use Lectero\Laragate\Traits\HasPermissions;

class User extends Authenticatable
{
    use HasPermissions;
}

4. Add the middleware to your routes

Route::group(['middleware' => ['permission:permission name']], function () {
    // your routes
});

License

The MIT License (MIT). Please see License File for more information.

Credits