⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.138
Server IP:
186.226.58.36
Server:
Linux da02.sh15.net 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
Server Software:
Apache/2
PHP Version:
8.1.32
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
redesystem
/
public_html
/
sys
/
app
/
Exceptions
/
View File Name :
Handler.php
<?php namespace App\Exceptions; use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\Response; use Illuminate\Validation\ValidationException; use Throwable; class Handler extends ExceptionHandler { /** * A list of the inputs that are never flashed for validation exceptions. * * @var array */ protected $dontFlash = [ 'current_password', 'password', 'password_confirmation', ]; /** * Register the exception handling callbacks for the application. */ public function register(): void { $this->reportable(function (Throwable $e) { // }); } public function render($request, Throwable $exception) { $code = $exception->getCode(); $message = $exception->getMessage(); if ($code < 100 || $code >= 600) { $code = \Illuminate\Http\Response::HTTP_INTERNAL_SERVER_ERROR; } if ($exception instanceof ModelNotFoundException) { $message = $exception->getMessage(); $code = \Illuminate\Http\Response::HTTP_NOT_FOUND; if (preg_match('@\\\\(\w+)\]@', $message, $matches)) { $model = $matches[1]; $model = preg_replace('/Table/i', '', $model); $message = "{$model} not found."; } } if ($exception instanceof ValidationException) { $validator = $exception->validator; $message = $validator->errors()->first(); $code = \Illuminate\Http\Response::HTTP_UNPROCESSABLE_ENTITY; if (! $request->expectsJson() and ! $request->isXmlHttpRequest()) { return Redirect::back()->withInput()->withErrors($message); } } if ($request->expectsJson() or $request->isXmlHttpRequest()) { return Response::json([ 'success' => false, 'message' => $message, ], $code); } return parent::render($request, $exception); } }