i74ifa/role-craft

automating role creation and permission management with Spatie/Laravel-Permission.

Installs: 16

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 1

Open Issues: 0

pkg:composer/i74ifa/role-craft

v1.1.4 2025-05-28 17:53 UTC

This package is auto-updated.

Last update: 2025-09-28 18:40:03 UTC


README

Latest Version on Packagist Total Downloads GitHub Actions

Installation

composer require i74ifa/role-craft

optional

publish config

php artisan vendor:publish --tag=role-craft-config

Usage

Generate role and Permissions

php artisan role-craft:generate

this command will be generate all permissions and role-craft.default_role will be created if you want to change default role name, you can change it in config/role-craft.php after publish config

Sync permissions

php artisan role-craft:sync manager --all

this will be sync all permissions to manager role if it exists if not exists you want to use --create option

php artisan role-craft:sync manager --create

if you want to sync some role from models use --models option

php artisan role-craft:sync manager --models=User --models=Post

# OR Custom Directory
php artisan role-craft:sync manager --models=App\Models\Directory\User

Generate role if not exists

php artisan role-craft:sync manager --create

License

This package is released under the MIT license.