nonetallt / laravel-permission-blueprints
Update spatie/laravel-permission package database roles and permissions easily using json blueprints.
Requires
- nonetallt/php-helpers: ^0.20.0
- spatie/laravel-permission: ^3.0
Requires (Dev)
- matthewbdaly/artisan-standalone: 0.0.*
- mockery/mockery: ~1.0
- orchestra/testbench: ^3.7
- orchestra/testbench-browser-kit: ^3.7
- php-coveralls/php-coveralls: ^2.1
- phpstan/phpstan: ^0.10.5
- phpunit/phpunit: ^7.0
- psy/psysh: ^0.9.8
- sebastian/phpcpd: ^4.0
- spatie/phpunit-watcher: ^1.11
- squizlabs/php_codesniffer: ^3.3
This package is auto-updated.
Last update: 2024-10-29 06:24:55 UTC
README
Create json blueprints for your application roles and permissions to easily update permissions without having to run manual modifications or multiple seeders for your database. Built to be used with spatie/laravel-permission laravel package.
Permissions
Create your permission json blueprint and set the path in config.
[ "permission-1", "permission-2", "permission-3", "permission-4" ]
Update permissions using this command. Old permissions are removed and new ones are added.
php artisan permissions:update
Roles
Create your role json blueprint and set the path in config.
[ { "name": "superadmin", "permissions": "all" }, { "name": "admin", "permissions": [ "permission-1", "permission-2", "permission-3" ] }, { "name": "user", "permissions": [ "permission-1" ] } ]
Update roles using this command. Old roles are removed and new ones are added. Additionally, permissions for each role are updated. This command also updates permissions first to make sure they exist before attempting to attach any permissions for roles.
php artisan roles:update