diff options
author | Frankie B <git@diskfloppy.me> | 2024-01-26 12:26:37 +0000 |
---|---|---|
committer | Frankie B <git@diskfloppy.me> | 2024-01-26 12:26:37 +0000 |
commit | fdeb7f1c48dad903b5c6f0297ce363eb71b9d216 (patch) | |
tree | 24e3e927922bb1c078be189ad5e405605c6c59b7 /resources/views/pages/guestbook.blade.php | |
parent | 7d0c7e41bf6b1c221311e5e0c7d1f8ad7ef31e7a (diff) |
Add UA to guestbook
Diffstat (limited to 'resources/views/pages/guestbook.blade.php')
-rw-r--r-- | resources/views/pages/guestbook.blade.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/resources/views/pages/guestbook.blade.php b/resources/views/pages/guestbook.blade.php index f506a99..a2c39fb 100644 --- a/resources/views/pages/guestbook.blade.php +++ b/resources/views/pages/guestbook.blade.php @@ -2,6 +2,8 @@ @section('title', 'Guestbook') @section('content') @php + use UAParser\Parser; + $parser = Parser::create(); $db_alive = true; try { DB::connection()->getPdo(); @@ -66,13 +68,16 @@ <hr> @php $entries = DB::select(' - SELECT name, timestamp, message + SELECT name, timestamp, message, agent FROM guestbook__entries ORDER BY id DESC '); @endphp <h2>Entries <small>({{ count($entries) }} total)</small></h2> @foreach ($entries as $entry) + @php + $user_agent = $parser->parse($entry->agent); + @endphp <table class="gb-entry" role="presentation"> <tr> <td> @@ -81,6 +86,13 @@ at <strong>{{ gmdate('h:i:s A (e)', $entry->timestamp) }}</strong> <hr> {{ $entry->message }} + <hr> + @if($entry->agent === "Agent Unavailable") + <address>Agent unavailable</address> + @else + <address>Posted using <strong>{{ $user_agent->ua->toString() }}</strong> + on <strong>{{ $user_agent->os->toString() }}</strong></address> + @endif </td> </tr> </table> |