role/rolebasesystem

This will use for create your app with rolebase system

dev-master 2023-08-18 13:20 UTC

This package is auto-updated.

Last update: 2024-10-18 16:00:58 UTC


README

Latest Version on Packagist Total Downloads License

The Role-Based System Laravel Package provides a robust and flexible role management solution for Laravel applications. Easily implement and manage user roles, permissions, and access control with this package.

Indexing

  1. Features
  2. Installation
  3. Migration
  4. Publish
  5. Routes
  6. Run

Features

  • Define and manage user roles with associated permissions.
  • Grant or revoke permissions to roles and individual users.
  • Protect routes and actions based on user roles and permissions.
  • Simplified and intuitive API for role and permission management.
  • Integration with Laravel's built-in authentication system.
  • Easily extendable and customizable to fit your application's needs.

Installation

You can install the package via composer:

composer require role/rolebasesystem

Migration

  • After you install package you have to migrate tables.
  • You must check first you env file have DB connection ? if no then first connect you DB.
  • Your DB connection is success then hit this command:
  • Migration command successfully run then your DB show four tables permissions, permission_group, role, role_permissions.
php artisan migrate

Publish

  • After migration complete we will publish package.
  • View folder store some package view files ('vendor/rolebasesystem/').
  • Controller store package controller inside (role/rolebasesystem/).
  • Model store package model inside (role/rolebasesystem/).
  • Able change package view,controller,model.
 php artisan vendor:publish --tag=rolebasesystem

Routes

  • route use in this package
 //role 
    Route::view('/role', 'rolebasesystem::role');
    Route::get('/getrole', [Role::class, "getRole"]);
    Route::post('/addrole', [Role::class, "addRole"]);
    Route::post('/editrole', [Role::class, "editRole"]);
    Route::post('/deleterole', [Role::class, "deleteRole"]);

    //permission 
    Route::view('/permission', 'rolebasesystem::permission');
    Route::get('/getpermission', [Permission::class, "getPermission"]);
    Route::post('/addpermission', [Permission::class, "addPermission"]);
    Route::post('/editpermission', [Permission::class, "editPermission"]);
    Route::post('/deletepermission', [Permission::class, "deletePermission"]);

    //permission group
    Route::view('/permissiongroup', 'rolebasesystem::permissiongroup');
    Route::get('/getpermissiongroup', [Permissiongroup::class, "getPermissionGroup"]);
    Route::post('/addpermissiongroup', [Permissiongroup::class, "addPermissionGroup"]);
    Route::post('/editpermissiongroup', [Permissiongroup::class, "editPermissionGroup"]);
    Route::post('/deletepermissiongroup', [Permissiongroup::class, "deletePermissionGroup"]);


    //permission of roles
    Route::view('/permissionofroles', 'rolebasesystem::permissionofroles');
    Route::post('/getpermissionofroles', [Permissionofroles::class, "getPermissionOfRoles"]);
    Route::post('/savepermission', [Permissionofroles::class, "savePermission"]);

Run

-run this command:

php artisan serve