@extends('layouts.default') @section('title', 'Guestbook') @section('content') @php use UAParser\Parser; $parser = Parser::create(); $db_alive = true; try { DB::connection()->getPdo(); } catch (Exception $e) { $db_alive = false; } @endphp @if (!$db_alive) @include('components.errors.db-error') @else

@php $entries = DB::select(' 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
@endforeach @endif @stop