diff --git a/web/app/Exceptions/Handler.php b/web/app/Exceptions/Handler.php index 9de6cdd..8a53c32 100644 --- a/web/app/Exceptions/Handler.php +++ b/web/app/Exceptions/Handler.php @@ -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); }); diff --git a/web/resources/views/errors/400.blade.php b/web/resources/views/errors/400.blade.php new file mode 100644 index 0000000..21877f4 --- /dev/null +++ b/web/resources/views/errors/400.blade.php @@ -0,0 +1,17 @@ +@extends('layouts.app') + +@section('content') +
+ + + There was a problem with your request. If you believe this is an error on our part, contact us at support@gtoria.net! + + +
+ Home + Back +
+
+
+
+@endsection diff --git a/web/resources/views/errors/401.blade.php b/web/resources/views/errors/401.blade.php new file mode 100644 index 0000000..c42bee7 --- /dev/null +++ b/web/resources/views/errors/401.blade.php @@ -0,0 +1,17 @@ +@extends('layouts.app') + +@section('content') +
+ + + You aren't authorized to view this page. If you believe this is an error, contact us at support@gtoria.net! + + +
+ Home + Back +
+
+
+
+@endsection diff --git a/web/resources/views/errors/403.blade.php b/web/resources/views/errors/403.blade.php new file mode 100644 index 0000000..5f00476 --- /dev/null +++ b/web/resources/views/errors/403.blade.php @@ -0,0 +1,17 @@ +@extends('layouts.app') + +@section('content') +
+ + + You don't have permission to view this page. If you believe this is an error, contact us at support@gtoria.net! + + +
+ Home + Back +
+
+
+
+@endsection