diff options
author | Frankie B <git@diskfloppy.me> | 2023-09-08 23:19:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-08 23:19:40 +0100 |
commit | 26901f82220fe18c0ad6e2bfc23c59b451a4e198 (patch) | |
tree | b199f4d6680b8b62869e5062768e519db846511d /resources/views/pages/guestbook.blade.php | |
parent | 5d148485408bb169cba60c9a82d188442630d233 (diff) |
feat: add error handling (#14)
* Remove commented out crap
* Update theme to use some colors from catppuccin, add error handling for API/DB
Diffstat (limited to 'resources/views/pages/guestbook.blade.php')
-rw-r--r-- | resources/views/pages/guestbook.blade.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/resources/views/pages/guestbook.blade.php b/resources/views/pages/guestbook.blade.php index 08bc7cb..13415b4 100644 --- a/resources/views/pages/guestbook.blade.php +++ b/resources/views/pages/guestbook.blade.php @@ -1,13 +1,24 @@ @extends('layouts.default') @section('title', 'Guestbook') @section('content') + @php + $db_alive = true; + try { + DB::connection()->getPdo(); + } catch (Exception $e) { + $db_alive = false; + } + @endphp + @if (!$db_alive) + @include('components.errors.db-error') + @else <br> <table class="gb-entry-form-container"> <tr> <td> <form method="POST" action="/guestbook"> @csrf - <x-honeypot /> + <x-honeypot/> <table class="gb-entry-form"> <tr> <td> @@ -44,7 +55,7 @@ <p>A few things to note:</p> <ul> <li>You can submit an entry <u>once every hour</u>.</li> - <li>Your IP address is logged but <u>not</u> publically displayed.</li> + <li>Your IP address is logged but <u>not</u> publicly displayed.</li> <li>Any entries that appear to be spam <u>will</u> be removed.</li> </ul> </td> @@ -74,4 +85,5 @@ </table> <br> @endforeach + @endif @stop |