Files
Paymenter-Version-Tracks/app/Exceptions/ErrorHandler.php
Muhammad Tamir b3933b9960 v1.4.0
2025-11-14 10:59:24 +07:00

33 lines
767 B
PHP

<?php
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
class ErrorHandler extends Handler
{
// We are overriding this method to change the view namespace separator from '::' to '.' (so themes can override error views)
/**
* Get the view used to render HTTP exceptions.
*
* @return string|null
*/
protected function getHttpExceptionView(HttpExceptionInterface $e)
{
$view = 'errors.' . $e->getStatusCode();
if (view()->exists($view)) {
return $view;
}
$view = substr($view, 0, -2) . 'xx';
if (view()->exists($view)) {
return $view;
}
return null;
}
}