PHPackages                             sudippalash/role-creator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. sudippalash/role-creator

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

sudippalash/role-creator
========================

Laravel Package for Role Management. This package uses the Spatie Laravel Permission package and includes role CRUD functionality &amp; Seeder for permission.

1.2.6(1y ago)13591MITBladePHP ^7.3|^8.0

Since Jul 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/sudippalash/role-creator)[ Packagist](https://packagist.org/packages/sudippalash/role-creator)[ RSS](/packages/sudippalash-role-creator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (20)Used By (0)

Role Creator
------------

[](#role-creator)

[![alt text](https://github.com/sudippalash/role-creator/raw/master/img.jpg?raw=true)](https://github.com/sudippalash/role-creator/blob/master/img.jpg?raw=true)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e729d3e51e8a3092bf7015c716484a3f2c5f297a3465662c6f087e602fa91023/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737564697070616c6173682f726f6c652d63726561746f723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sudippalash/role-creator)[![Total Downloads](https://camo.githubusercontent.com/2f97f82ffe29a53d47a283e4eed4a43edbdefbc00fcdae730ff1be648e436941/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737564697070616c6173682f726f6c652d63726561746f723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sudippalash/role-creator)

`role-creator` is a role management package of `Laravel` that provides options to manage role for auth users.

Note: This package is wrapper of `spatie/laravel-permission` package.

Install
-------

[](#install)

Via Composer

```
composer require sudippalash/role-creator
```

### Publish config, migrations &amp; seeders files

[](#publish-config-migrations--seeders-files)

You should publish

migrations files:

1. `database/migrations/create_permission_tables.php`
2. `database/migrations/add_module_column_to_permissions_table.php`,

config files:

1. `config/permission.php`,
2. `config/role-creator.php`

and seeders file:

1. `database/seeders/PermissionSeeder.php`

with:

```
php artisan vendor:publish --provider="Sudip\RoleCreator\Providers\AppServiceProvider" --tag=required
```

For `config/permission.php` file you should check `spatie/laravel-permission` package documentation.

This is the contents of the published config file `config/role-creator.php`:

```
return [
    /*
    |--------------------------------------------------------------------------
    | Extends Layout Name
    |--------------------------------------------------------------------------
    |
    | Your main layout file path name. Example: layouts.app
    |
    */

    'layout_name' => 'layouts.app',

    /*
    |--------------------------------------------------------------------------
    | Section Name
    |--------------------------------------------------------------------------
    |
    | Your section name which in yield in main layout file. Example: content
    |
    */

    'section_name' => 'content',

    /*
    |--------------------------------------------------------------------------
    | Route Name, Prefix & Middleware
    |--------------------------------------------------------------------------
    |
    | Provide a route name for role route. Example: user.roles
    | Provide a prefix name for role url. Example: user/roles
    | If role route use any middleware then provide it or leave empty array. Example: ['auth']
    */

    'route_name' => 'user.roles',
    'route_prefix' => 'user/roles',
    'middleware' => [],

    /*
    |--------------------------------------------------------------------------
    | Role & Permission Name Pretty Print
    |--------------------------------------------------------------------------
    |
    | You can set the delimiter to separate your role/permission name for pretty preview
    | Example: array('-', '_', '=', '|', '/')
    |
    */

    'role_permission_name_separator' => ['-', '_'],

    /*
    |--------------------------------------------------------------------------
    | Auth Guard Name
    |--------------------------------------------------------------------------
    |
    | Which authentication guard you use for role. Example: web or admin
    |
    */

    'auth_guard_name' => 'web',

    /*
    |--------------------------------------------------------------------------
    | Role Prevent
    |--------------------------------------------------------------------------
    |
    | Those role names hide from list and prevent from edit & delete. Example ['Super Admin']
    |
    */

    'hide_role_names' => [],

    /*
    |--------------------------------------------------------------------------
    | Bootstrap version
    |--------------------------------------------------------------------------
    |
    | Which bootstrap you use in your application. Example: 3 or 4 or 5
    |
    */

    'bootstrap_v' => 4,

    /*
    |--------------------------------------------------------------------------
    | Flash Messages
    |--------------------------------------------------------------------------
    |
    | After Save/Update flash message session key name
    |
    */

    'flash_success' => 'success',
    'flash_error' => 'error',

    /*
    |--------------------------------------------------------------------------
    | CSS
    |--------------------------------------------------------------------------
    |
    | Add your css class in this property if you want to change design.
    */

    'css' => [
        'container' => null,
        'card' => null,
        'input' => null,
        'btn' => null,
        'table' => null,
        'table_action_col_width' => null,
        'table_action_btn' => null,
    ],
];
```

Optionally, you can publish the views using

```
php artisan vendor:publish --provider="Sudip\RoleCreator\Providers\AppServiceProvider" --tag=views
```

Optionally, you can publish the lang using

```
php artisan vendor:publish --provider="Sudip\RoleCreator\Providers\AppServiceProvider" --tag=lang
```

You should run the migrations with:

```
php artisan migrate
```

In `database/seeders/PermissionSeeder.php` seed file you should set your permission data and then you should run the seed with:

```
php artisan db:seed --class=PermissionSeeder
```

Usage
-----

[](#usage)

You should copy the below line and paste in your project menu section

```
{{ trans('role-creator::sp_role_creator.roles') }}
```

Optional
--------

[](#optional)

### If want to use this for multiple guard then you can use RoleCreator trait.

[](#if-want-to-use-this-for-multiple-guard-then-you-can-use-rolecreator-trait)

```
use Sudip\RoleCreator\Traits\RoleCrud;

class YourController extends Controller
{
    use RoleCrud;

    protected $guardName;

    protected $routeName;

    protected $hideRoles;

    public function __construct()
    {
        $this->guardName = '{your guard_name}';
        $this->routeName = '{your resource route name}';
        $this->hideRoles = '{if you want to hide any roles}';
    }
}
```

###  Health Score

36

—

LowBetter than 81% of packages

Maintenance48

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~54 days

Recently: every ~38 days

Total

19

Last Release

411d ago

PHP version history (2 changes)1.2.1PHP ^7.3|^8.3

1.2.4PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e4dad3b25d885d7ee33085d1a82851871161020923a26ac2b2276e5950c201a?d=identicon)[sudippalash](/maintainers/sudippalash)

---

Top Contributors

[![sudippalash](https://avatars.githubusercontent.com/u/16589727?v=4)](https://github.com/sudippalash "sudippalash (31 commits)")

---

Tags

laravelRole ManagementSudiplaravel role management

### Embed Badge

![Health badge](/badges/sudippalash-role-creator/health.svg)

```
[![Health](https://phpackages.com/badges/sudippalash-role-creator/health.svg)](https://phpackages.com/packages/sudippalash-role-creator)
```

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[hosseinhezami/laravel-permission-manager

Advanced permission manager for Laravel.

403.3k](/packages/hosseinhezami-laravel-permission-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
