fahmiardi/laravel-permission-command
Laravel Permission Console Commands
This is out of the box package managing permission via console command for Spatie Laravel Permission
Install
composer require fahmiardi/laravel-permission-command
Register service provider by adding to your config/app.php:
...
Fahmiardi\Permissions\Commands\PermissionCommandServiceProvider::class,
Once installed you can do stuff like this:
php artisan list
You must see:
permission
permission:assign-role Assign role(s) to user
permission:create-permission Create permission
permission:create-role Create role
permission:give-permission Give permission(s) to user or role
Usage
###Create Permission
php artisan permission:create-permission
###Create Role
php artisan permission:create-role
###Assign Role to User
php artisan permission:assign-role
###Give permission to User and Role type
php artisan permission:give-permission #type will be asked
php artisan permission:give-permission --user
php artisan permission:give-permission --role