Download the PHP package i74ifa/role-craft without Composer
On this page you can find all versions of the php package i74ifa/role-craft. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download i74ifa/role-craft
More information about i74ifa/role-craft
Files in i74ifa/role-craft
Package role-craft
Short Description automating role creation and permission management with Spatie/Laravel-Permission.
License MIT
Homepage https://github.com/i74ifa/role-craft
Informations about the package role-craft
Role-Craft for spatie/laravel-permission
Installation
Version Compatibility
| Version | Laravel | Spatie Permission | PHP |
|---|---|---|---|
| v2.x | 12.0+ / 13.0+ | 7.0+ | 8.4+ |
| v1.x | 10.0+ / 11.0+ | 6.x | 8.2+ |
optional
publish config
AI agent guide
This package ships an agent-neutral usage guide for AI coding assistants at:
It covers every config key, command flag, per-model override, naming rule, and common recipe in one place. It is plain Markdown — readable by humans and by any agent (Cursor, Cline, Aider, GitHub Copilot, Codex, Claude Code, etc.).
To make your agent pick it up automatically, reference the path from whichever rules file your tool uses, for example:
AGENTS.md(Codex / generic) — link or include the file..cursor/rules/*.mdc(Cursor) —@vendor/i74ifa/role-craft/docs/AGENT_GUIDE.md..github/copilot-instructions.md(GitHub Copilot) — link to the file.CLAUDE.mdor.claude/skills/role-craft/SKILL.md(Claude Code) — link to or copy the file..clinerules,.windsurfrules,.continuerules— reference the file path.
Usage
Generate role and Permissions
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
this will be sync all permissions to manager role if it exists
if not exists you want to use --create option
if you want to sync some role from models use --models option
Generate role if not exists
Including models (whitelist)
Some projects don't need permissions for every model in app/Models. To restrict scanning to a curated set, fill included_models in config/role-craft.php. When the list is non-empty, role-craft only processes models matching one of the patterns — everything else is treated as "excluded all":
When included_models is empty (the default), every Eloquent model under models_path is included.
Excluding models (blacklist)
If you want to skip one or more models, add them to the excluded_models array. Excludes are applied after the include filter, so you can whitelist a subtree and then carve a few classes out of it:
Notes:
- Both filters use
fnmatchon the fully-qualified class name (leading backslashes are normalized). - The filters are only applied during directory scans. Passing
--models=Fooexplicitly still includesFoo— user intent wins. - Order of operations:
included_modelsfirst (if non-empty), thenexcluded_models.
Per-model customization
Override the permission name or action list on a specific model by declaring public properties on it:
License
This package is released under the MIT license.
All versions of role-craft with dependencies
illuminate/support Version ^12.0|^13.0
spatie/laravel-permission Version ^7.0