/Laravel-Permission-Manager

Create and manage all your permissions and routes using the user interface | PACKAGE

Primary LanguagePHPMIT LicenseMIT

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.

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