����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 18.119.102.182 Web Server : LiteSpeed System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : gltevjme ( 1095) PHP Version : 7.0.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/gltevjme/./cbt.bofirm.com/vendor/spatie/laravel-permission/src/Commands/ |
Upload File : |
<?php namespace Spatie\Permission\Commands; use Illuminate\Console\Command; use Spatie\Permission\Contracts\Permission as PermissionContract; use Spatie\Permission\Contracts\Role as RoleContract; class CreateRole extends Command { protected $signature = 'permission:create-role {name : The name of the role} {guard? : The name of the guard} {permissions? : A list of permissions to assign to the role, separated by | }'; protected $description = 'Create a role'; public function handle() { $roleClass = app(RoleContract::class); $role = $roleClass::findOrCreate($this->argument('name'), $this->argument('guard')); $role->givePermissionTo($this->makePermissions($this->argument('permissions'))); $this->info("Role `{$role->name}` created"); } /** * @param array|null|string $string */ protected function makePermissions($string = null) { if (empty($string)) { return; } $permissionClass = app(PermissionContract::class); $permissions = explode('|', $string); $models = []; foreach ($permissions as $permission) { $models[] = $permissionClass::findOrCreate(trim($permission), $this->argument('guard')); } return collect($models); } }