{"id":22165353,"url":"https://github.com/asiifdev/easy-role","last_synced_at":"2025-08-03T03:37:48.553Z","repository":{"id":86491849,"uuid":"606755393","full_name":"asiifdev/easy-role","owner":"asiifdev","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-09T12:31:58.000Z","size":98,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T21:50:35.005Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asiifdev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-26T13:26:46.000Z","updated_at":"2023-09-13T12:30:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"f51d8179-c3ad-4826-989b-ca56e505c10a","html_url":"https://github.com/asiifdev/easy-role","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"spatie/package-skeleton-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asiifdev%2Feasy-role","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asiifdev%2Feasy-role/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asiifdev%2Feasy-role/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asiifdev%2Feasy-role/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asiifdev","download_url":"https://codeload.github.com/asiifdev/easy-role/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245304873,"owners_count":20593626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T05:14:40.351Z","updated_at":"2025-03-24T16:13:45.520Z","avatar_url":"https://github.com/asiifdev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ini adalah Package untuk memudahkan dalam Management Role dan Permissions di Laravel\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/asiifdev/easy-role.svg?style=flat-square)](https://packagist.org/packages/asiifdev/easy-role)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/asiifdev/easy-role/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/asiifdev/easy-role/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/asiifdev/easy-role/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/asiifdev/easy-role/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/asiifdev/easy-role.svg?style=flat-square)](https://packagist.org/packages/asiifdev/easy-role)\n\n\u003c!-- This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. --\u003e\n\u003c!-- \n## Support us\n\n[\u003cimg src=\"https://github-ads.s3.eu-central-1.amazonaws.com/easy-role.jpg?t=1\" width=\"419px\" /\u003e](https://spatie.be/github-ad-click/easy-role)\n\nWe invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).\n\nWe highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards). --\u003e\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require asiifdev/easy-role\n```\n\nYou can publish and run the migrations with:\n\n```bash\nphp artisan vendor:publish --provider=\"Asiifdev\\EasyRole\\EasyRoleServiceProvider\"\nphp artisan migrate\n```\n\nThis is the contents of the published config file:\n\n```php\nreturn [\n    'models' =\u003e [\n\n        /*\n         * When using the \"HasPermissions\" trait from this package, we need to know which\n         * Eloquent model should be used to retrieve your permissions. Of course, it\n         * is often just the \"Permission\" model but you may use whatever you like.\n         *\n         * The model you want to use as a Permission model needs to implement the\n         * `Asiifdev\\EasyRole\\Contracts\\Permission` contract.\n         */\n\n        'permission' =\u003e Asiifdev\\EasyRole\\Models\\Permission::class,\n\n        /*\n         * When using the \"HasRoles\" trait from this package, we need to know which\n         * Eloquent model should be used to retrieve your roles. Of course, it\n         * is often just the \"Role\" model but you may use whatever you like.\n         *\n         * The model you want to use as a Role model needs to implement the\n         * `Asiifdev\\EasyRole\\Contracts\\Role` contract.\n         */\n\n        'role' =\u003e Asiifdev\\EasyRole\\Models\\Role::class,\n\n    ],\n\n    'table_names' =\u003e [\n\n        /*\n         * When using the \"HasRoles\" trait from this package, we need to know which\n         * table should be used to retrieve your roles. We have chosen a basic\n         * default value but you may easily change it to any table you like.\n         */\n\n        'roles' =\u003e 'roles',\n\n        /*\n         * When using the \"HasPermissions\" trait from this package, we need to know which\n         * table should be used to retrieve your permissions. We have chosen a basic\n         * default value but you may easily change it to any table you like.\n         */\n\n        'permissions' =\u003e 'permissions',\n\n        /*\n         * When using the \"HasPermissions\" trait from this package, we need to know which\n         * table should be used to retrieve your models permissions. We have chosen a\n         * basic default value but you may easily change it to any table you like.\n         */\n\n        'model_has_permissions' =\u003e 'model_has_permissions',\n\n        /*\n         * When using the \"HasRoles\" trait from this package, we need to know which\n         * table should be used to retrieve your models roles. We have chosen a\n         * basic default value but you may easily change it to any table you like.\n         */\n\n        'model_has_roles' =\u003e 'model_has_roles',\n\n        /*\n         * When using the \"HasRoles\" trait from this package, we need to know which\n         * table should be used to retrieve your roles permissions. We have chosen a\n         * basic default value but you may easily change it to any table you like.\n         */\n\n        'role_has_permissions' =\u003e 'role_has_permissions',\n    ],\n\n    'column_names' =\u003e [\n        /*\n         * Change this if you want to name the related pivots other than defaults\n         */\n        'role_pivot_key' =\u003e null, //default 'role_id',\n        'permission_pivot_key' =\u003e null, //default 'permission_id',\n\n        /*\n         * Change this if you want to name the related model primary key other than\n         * `model_id`.\n         *\n         * For example, this would be nice if your primary keys are all UUIDs. In\n         * that case, name this `model_uuid`.\n         */\n\n        'model_morph_key' =\u003e 'model_id',\n\n        /*\n         * Change this if you want to use the teams feature and your related model's\n         * foreign key is other than `team_id`.\n         */\n\n        'team_foreign_key' =\u003e 'team_id',\n    ],\n\n    /*\n     * When set to true, the method for checking permissions will be registered on the gate.\n     * Set this to false, if you want to implement custom logic for checking permissions.\n     */\n\n    'register_permission_check_method' =\u003e true,\n\n    /*\n     * When set to true the package implements teams using the 'team_foreign_key'. If you want\n     * the migrations to register the 'team_foreign_key', you must set this to true\n     * before doing the migration. If you already did the migration then you must make a new\n     * migration to also add 'team_foreign_key' to 'roles', 'model_has_roles', and\n     * 'model_has_permissions'(view the latest version of package's migration file)\n     */\n\n    'teams' =\u003e false,\n\n    /*\n     * When set to true, the required permission names are added to the exception\n     * message. This could be considered an information leak in some contexts, so\n     * the default setting is false here for optimum safety.\n     */\n\n    'display_permission_in_exception' =\u003e false,\n\n    /*\n     * When set to true, the required role names are added to the exception\n     * message. This could be considered an information leak in some contexts, so\n     * the default setting is false here for optimum safety.\n     */\n\n    'display_role_in_exception' =\u003e false,\n\n    /*\n     * By default wildcard permission lookups are disabled.\n     */\n\n    'enable_wildcard_permission' =\u003e false,\n\n    'cache' =\u003e [\n\n        /*\n         * By default all permissions are cached for 24 hours to speed up performance.\n         * When permissions or roles are updated the cache is flushed automatically.\n         */\n\n        'expiration_time' =\u003e \\DateInterval::createFromDateString('24 hours'),\n\n        /*\n         * The cache key used to store all permissions.\n         */\n\n        'key' =\u003e 'spatie.permission.cache',\n\n        /*\n         * You may optionally indicate a specific cache driver to use for permission and\n         * role caching using any of the `store` drivers listed in the cache.php config\n         * file. Using 'default' here means to use the `default` set in cache.php.\n         */\n\n        'store' =\u003e 'default',\n    ],\n];\n```\n\n## Usage\n\n```php\n$easyRole = new Asiifdev\\EasyRole();\necho $easyRole-\u003eechoPhrase('Hello, Asiifdev!');\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [asiifdev](https://github.com/asiifdev)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasiifdev%2Feasy-role","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasiifdev%2Feasy-role","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasiifdev%2Feasy-role/lists"}