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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/queuepro/vendor/spatie/laravel-permission/src/Commands/   drwxrwxr-x
Free 13.04 GB of 57.97 GB (22.49%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     Show.php (2.81 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Spatie\Permission\Commands;

use 
Illuminate\Console\Command;
use 
Illuminate\Support\Collection;
use 
Spatie\Permission\Contracts\Permission as PermissionContract;
use 
Spatie\Permission\Contracts\Role as RoleContract;
use 
Symfony\Component\Console\Helper\TableCell;

class 
Show extends Command
{
    protected 
$signature 'permission:show
            {guard? : The name of the guard}
            {style? : The display style (default|borderless|compact|box)}'
;

    protected 
$description 'Show a table of roles and permissions per guard';

    public function 
handle()
    {
        
$permissionClass app(PermissionContract::class);
        
$roleClass app(RoleContract::class);
        
$team_key config('permission.column_names.team_foreign_key');

        
$style $this->argument('style') ?? 'default';
        
$guard $this->argument('guard');

        if (
$guard) {
            
$guards Collection::make([$guard]);
        } else {
            
$guards $permissionClass::pluck('guard_name')->merge($roleClass::pluck('guard_name'))->unique();
        }

        foreach (
$guards as $guard) {
            
$this->info("Guard: $guard");

            
$roles $roleClass::whereGuardName($guard)
                ->
with('permissions')
                ->
when(config('permission.teams'), function ($q) use ($team_key) {
                    
$q->orderBy($team_key);
                })
                ->
orderBy('name')->get()->mapWithKeys(function ($role) use ($team_key) {
                    return [
$role->name.'_'.($role->$team_key ?: '') => ['permissions' => $role->permissions->pluck('id'), $team_key => $role->$team_key]];
                });

            
$permissions $permissionClass::whereGuardName($guard)->orderBy('name')->pluck('name''id');

            
$body $permissions->map(function ($permission$id) use ($roles) {
                return 
$roles->map(function (array $role_data) use ($id) {
                    return 
$role_data['permissions']->contains($id) ? ' ✔' ' ·';
                })->
prepend($permission);
            });

            if (
config('permission.teams')) {
                
$teams $roles->groupBy($team_key)->values()->map(function ($group$id) {
                    return new 
TableCell('Team ID: '.($id ?: 'NULL'), ['colspan' => $group->count()]);
                });
            }

            
$this->table(
                
array_merge([
                    
config('permission.teams') ? $teams->prepend('')->toArray() : [],
                    
$roles->keys()->map(function ($val) {
                        
$name explode('_'$val);
                        
array_pop($name);

                        return 
implode('_'$name);
                    })
                    ->
prepend('')->toArray(),
                ]),
                
$body->toArray(),
                
$style
            
);
        }
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

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