diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 20c80561..8b5988a8 100755 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -67,4 +67,23 @@ class Handler extends ExceptionHandler return redirect()->guest('login'); } + + /** + * Render the given HttpException. + */ + protected function renderHttpException(\Symfony\Component\HttpKernel\Exception\HttpException $e) + { + $status = $e->getStatusCode(); + view()->replaceNamespace('errors', [ + resource_path('views/layouts/' . config('phpvms.skin') . '/errors'), + resource_path('views/errors'), + __DIR__ . '/views', + ]); + + if (view()->exists("errors::{$status}")) { + return response()->view("errors::{$status}", ['exception' => $e], $status, $e->getHeaders()); + } else { + return $this->convertExceptionToResponse($e); + } + } } diff --git a/resources/views/errors/401.blade.php b/resources/views/layouts/default/errors/401.blade.php similarity index 100% rename from resources/views/errors/401.blade.php rename to resources/views/layouts/default/errors/401.blade.php diff --git a/resources/views/errors/404.blade.php b/resources/views/layouts/default/errors/404.blade.php similarity index 100% rename from resources/views/errors/404.blade.php rename to resources/views/layouts/default/errors/404.blade.php diff --git a/resources/views/errors/503.blade.php b/resources/views/layouts/default/errors/503.blade.php similarity index 100% rename from resources/views/errors/503.blade.php rename to resources/views/layouts/default/errors/503.blade.php