More error pages.

This commit is contained in:
Graphictoria 2022-04-15 23:36:51 -04:00
parent d00bbab8e4
commit 4c8ea3e2b5
4 changed files with 66 additions and 0 deletions

View File

@ -3,6 +3,9 @@
namespace App\Exceptions;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
@ -35,6 +38,18 @@ class Handler extends ExceptionHandler
*/
public function register()
{
$this->renderable(function (BadRequestHttpException $e, $request) {
return response()->view('errors.400', [], 400);
});
$this->renderable(function (UnauthorizedHttpException $e, $request) {
return response()->view('errors.401', [], 401);
});
$this->renderable(function (AccessDeniedHttpException $e, $request) {
return response()->view('errors.403', [], 403);
});
$this->renderable(function (NotFoundHttpException $e, $request) {
return response()->view('errors.404', [], 404);
});

View File

@ -0,0 +1,17 @@
@extends('layouts.app')
@section('content')
<div class="container graphictoria-center-vh">
<x-card title="UNAUTHORIZED">
<x-slot name="body">
There was a problem with your request. If you believe this is an error on our part, contact us at <a href="mailto:support@gtoria.net" class="fw-bold text-decoration-none">support@gtoria.net</a>!
</x-slot>
<x-slot name="footer">
<div class="mt-2">
<a class="btn btn-primary px-4 me-2" href="{{ url('/') }}">Home</a>
<a class="btn btn-secondary px-4" onclick="history.back();return false;">Back</a>
</div>
</x-slot>
</x-card>
</div>
@endsection

View File

@ -0,0 +1,17 @@
@extends('layouts.app')
@section('content')
<div class="container graphictoria-center-vh">
<x-card title="UNAUTHORIZED">
<x-slot name="body">
You aren't authorized to view this page. If you believe this is an error, contact us at <a href="mailto:support@gtoria.net" class="fw-bold text-decoration-none">support@gtoria.net</a>!
</x-slot>
<x-slot name="footer">
<div class="mt-2">
<a class="btn btn-primary px-4 me-2" href="{{ url('/') }}">Home</a>
<a class="btn btn-secondary px-4" onclick="history.back();return false;">Back</a>
</div>
</x-slot>
</x-card>
</div>
@endsection

View File

@ -0,0 +1,17 @@
@extends('layouts.app')
@section('content')
<div class="container graphictoria-center-vh">
<x-card title="UNAUTHORIZED">
<x-slot name="body">
You don't have permission to view this page. If you believe this is an error, contact us at <a href="mailto:support@gtoria.net" class="fw-bold text-decoration-none">support@gtoria.net</a>!
</x-slot>
<x-slot name="footer">
<div class="mt-2">
<a class="btn btn-primary px-4 me-2" href="{{ url('/') }}">Home</a>
<a class="btn btn-secondary px-4" onclick="history.back();return false;">Back</a>
</div>
</x-slot>
</x-card>
</div>
@endsection