From fdeb7f1c48dad903b5c6f0297ce363eb71b9d216 Mon Sep 17 00:00:00 2001 From: Frankie B Date: Fri, 26 Jan 2024 12:26:37 +0000 Subject: Add UA to guestbook --- resources/views/pages/guestbook.blade.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'resources') 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 @@
@php $entries = DB::select(' - SELECT name, timestamp, message + SELECT name, timestamp, message, agent FROM guestbook__entries ORDER BY id DESC '); @endphp

Entries ({{ count($entries) }} total)

@foreach ($entries as $entry) + @php + $user_agent = $parser->parse($entry->agent); + @endphp -- cgit v1.2.3-54-g00ecf