PHPackages                             asiifdev/easy-role - 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. asiifdev/easy-role

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

asiifdev/easy-role
==================

Ini adalah Package untuk memudahkan dalam Management Role dan Permissions di Laravel

v1.0.0(3y ago)016[3 PRs](https://github.com/asiifdev/easy-role/pulls)MITPHPPHP ^7.3|^8.0

Since Feb 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/asiifdev/easy-role)[ Packagist](https://packagist.org/packages/asiifdev/easy-role)[ Docs](https://github.com/asiifdev/easy-role)[ RSS](/packages/asiifdev-easy-role/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (7)Versions (5)Used By (0)

Ini adalah Package untuk memudahkan dalam Management Role dan Permissions di Laravel
====================================================================================

[](#ini-adalah-package-untuk-memudahkan-dalam-management-role-dan-permissions-di-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d704609bd11f1c2465ad95db6127b8f91534ef974c3c0a4e344222f2c5f0c876/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61736969666465762f656173792d726f6c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asiifdev/easy-role)[![GitHub Tests Action Status](https://camo.githubusercontent.com/baab384803c6d54abde7b1fe696853279184ce181f57544e29d8f85f7071fd4a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f61736969666465762f656173792d726f6c652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/asiifdev/easy-role/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/61efe99e41e55ecdeca19f07f5d1405e88312551ef9d6d04ca5e8b6f6bd9a1fd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f61736969666465762f656173792d726f6c652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/asiifdev/easy-role/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/ce27705d9fb9847d692f137ff2d24afbfbd550d90fe3c65fbb53854985fb46ec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61736969666465762f656173792d726f6c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asiifdev/easy-role)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require asiifdev/easy-role
```

You can publish and run the migrations with:

```
php artisan vendor:publish --provider="Asiifdev\EasyRole\EasyRoleServiceProvider"
php artisan migrate
```

This is the contents of the published config file:

```
return [
    'models' => [

        /*
         * When using the "HasPermissions" trait from this package, we need to know which
         * Eloquent model should be used to retrieve your permissions. Of course, it
         * is often just the "Permission" model but you may use whatever you like.
         *
         * The model you want to use as a Permission model needs to implement the
         * `Asiifdev\EasyRole\Contracts\Permission` contract.
         */

        'permission' => Asiifdev\EasyRole\Models\Permission::class,

        /*
         * When using the "HasRoles" trait from this package, we need to know which
         * Eloquent model should be used to retrieve your roles. Of course, it
         * is often just the "Role" model but you may use whatever you like.
         *
         * The model you want to use as a Role model needs to implement the
         * `Asiifdev\EasyRole\Contracts\Role` contract.
         */

        'role' => Asiifdev\EasyRole\Models\Role::class,

    ],

    'table_names' => [

        /*
         * When using the "HasRoles" trait from this package, we need to know which
         * table should be used to retrieve your roles. We have chosen a basic
         * default value but you may easily change it to any table you like.
         */

        'roles' => 'roles',

        /*
         * When using the "HasPermissions" trait from this package, we need to know which
         * table should be used to retrieve your permissions. We have chosen a basic
         * default value but you may easily change it to any table you like.
         */

        'permissions' => 'permissions',

        /*
         * When using the "HasPermissions" trait from this package, we need to know which
         * table should be used to retrieve your models permissions. We have chosen a
         * basic default value but you may easily change it to any table you like.
         */

        'model_has_permissions' => 'model_has_permissions',

        /*
         * When using the "HasRoles" trait from this package, we need to know which
         * table should be used to retrieve your models roles. We have chosen a
         * basic default value but you may easily change it to any table you like.
         */

        'model_has_roles' => 'model_has_roles',

        /*
         * When using the "HasRoles" trait from this package, we need to know which
         * table should be used to retrieve your roles permissions. We have chosen a
         * basic default value but you may easily change it to any table you like.
         */

        'role_has_permissions' => 'role_has_permissions',
    ],

    'column_names' => [
        /*
         * Change this if you want to name the related pivots other than defaults
         */
        'role_pivot_key' => null, //default 'role_id',
        'permission_pivot_key' => null, //default 'permission_id',

        /*
         * Change this if you want to name the related model primary key other than
         * `model_id`.
         *
         * For example, this would be nice if your primary keys are all UUIDs. In
         * that case, name this `model_uuid`.
         */

        'model_morph_key' => 'model_id',

        /*
         * Change this if you want to use the teams feature and your related model's
         * foreign key is other than `team_id`.
         */

        'team_foreign_key' => 'team_id',
    ],

    /*
     * When set to true, the method for checking permissions will be registered on the gate.
     * Set this to false, if you want to implement custom logic for checking permissions.
     */

    'register_permission_check_method' => true,

    /*
     * When set to true the package implements teams using the 'team_foreign_key'. If you want
     * the migrations to register the 'team_foreign_key', you must set this to true
     * before doing the migration. If you already did the migration then you must make a new
     * migration to also add 'team_foreign_key' to 'roles', 'model_has_roles', and
     * 'model_has_permissions'(view the latest version of package's migration file)
     */

    'teams' => false,

    /*
     * When set to true, the required permission names are added to the exception
     * message. This could be considered an information leak in some contexts, so
     * the default setting is false here for optimum safety.
     */

    'display_permission_in_exception' => false,

    /*
     * When set to true, the required role names are added to the exception
     * message. This could be considered an information leak in some contexts, so
     * the default setting is false here for optimum safety.
     */

    'display_role_in_exception' => false,

    /*
     * By default wildcard permission lookups are disabled.
     */

    'enable_wildcard_permission' => false,

    'cache' => [

        /*
         * By default all permissions are cached for 24 hours to speed up performance.
         * When permissions or roles are updated the cache is flushed automatically.
         */

        'expiration_time' => \DateInterval::createFromDateString('24 hours'),

        /*
         * The cache key used to store all permissions.
         */

        'key' => 'spatie.permission.cache',

        /*
         * You may optionally indicate a specific cache driver to use for permission and
         * role caching using any of the `store` drivers listed in the cache.php config
         * file. Using 'default' here means to use the `default` set in cache.php.
         */

        'store' => 'default',
    ],
];
```

Usage
-----

[](#usage)

```
$easyRole = new Asiifdev\EasyRole();
echo $easyRole->echoPhrase('Hello, Asiifdev!');
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [asiifdev](https://github.com/asiifdev)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.3% 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

Unknown

Total

1

Last Release

1222d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/51133847?v=4)[Muhammad Syaiful Anwar](/maintainers/asiifdev)[@asiifdev](https://github.com/asiifdev)

---

Top Contributors

[![asiifdev](https://avatars.githubusercontent.com/u/51133847?v=4)](https://github.com/asiifdev "asiifdev (22 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")

---

Tags

laravelasiifdeveasy-role

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/asiifdev-easy-role/health.svg)

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

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M193](/packages/laravel-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M130](/packages/roots-acorn)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.4k](/packages/larastan-larastan)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.5k91.9M594](/packages/laravel-passport)

PHPackages © 2026

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