look in skin folder for error files

This commit is contained in:
Nabeel Shahzad 2017-08-23 09:23:48 -05:00
parent 7fb13a95f2
commit 2c41144c61
4 changed files with 19 additions and 0 deletions

View File

@ -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);
}
}
}