fahmiardi / laravel-permission-command by fahmiardi

Console commands for Laravel Permission
45
1
1
Package Data
Maintainer Username: fahmiardi
Maintainer Contact: f4hem.net@gmail.com (Fahmi Ardi)
Package Create Date: 2016-12-18
Package Last Update: 2016-12-18
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-12-15 15:26:05
Package Statistics
Total Downloads: 45
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 1
Total Forks: 0
Total Open Issues: 1

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