allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
This commit is contained in:
24
vendor/spatie/laravel-permission/src/Commands/CreatePermission.php
vendored
Normal file
24
vendor/spatie/laravel-permission/src/Commands/CreatePermission.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\Permission\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Spatie\Permission\Contracts\Permission as PermissionContract;
|
||||
|
||||
class CreatePermission extends Command
|
||||
{
|
||||
protected $signature = 'permission:create-permission
|
||||
{name : The name of the permission}
|
||||
{guard? : The name of the guard}';
|
||||
|
||||
protected $description = 'Create a permission';
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$permissionClass = app(PermissionContract::class);
|
||||
|
||||
$permission = $permissionClass::findOrCreate($this->argument('name'), $this->argument('guard'));
|
||||
|
||||
$this->info("Permission `{$permission->name}` ".($permission->wasRecentlyCreated ? 'created' : 'already exists'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user