manukminasyan/laravel-permission-manager

Create and manage your all permissions and routes

v0.2.0 2019-09-15 11:27 UTC

This package is auto-updated.

Last update: 2024-03-26 20:23:18 UTC


README

logo.png

LaravelPermissionManager

Total Downloads License

LaravelPermissionManager - It is a modern and dynamic permission management system based on Bouncer.

Introduction

If you need to speed up project development, and you need to use permissions and roles in your project, This package is perfect for you. ui-control-panel.png

Installation

Install PermissionManager with composer:

$ composer require manukminasyan/laravel-permission-manager

The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file:

'providers' => [
    // ...
    ManukMinasyan\LaravelPermissionManager\LaravelPermissionManagerServiceProvider::class,
];

You can publish all the necessary files with:

php artisan vendor:publish --provider="ManukMinasyan\LaravelPermissionManager\LaravelPermissionManagerServiceProvider"

This is the contents of the published config file:

return [
    'database' => [
        'option_table' => 'permission_manager_options',
        'model_table' => 'permission_manager_models',

        'group_table' => 'permission_manager_groups',
        'route_table' => 'permission_manager_routes',
        'route_permission_table' => 'permission_manager_route_permission'
    ],

    'user_model' => \App\User::class,

    'middleware' => [
          'web', 'auth'
    ],

    'route' => 'permission-manager'
];

Add Bouncer's trait to your user model:

use Silber\Bouncer\Database\HasRolesAndAbilities;

class User extends Model
{
    use HasRolesAndAbilities;
}

Finally, run the migrations:

php artisan migrate

Congratulations, you have successfully set up the project. You can access the permission manager control panel using the URI "/permission-manager".

Important information

The development of the package is not complete fully. you can install and evaluate my work. Thanks