{{-- Page Header --}}
Events & Alerts Monitor and manage GPS tracking events
Refresh Mark All Read
{{-- Stats Cards --}}

Critical Alerts

{{ $this->criticalCount }}

Warnings

{{ $this->warningCount }}

Info Events

{{ $this->infoCount }}

Total Events

{{ $this->totalCount }}

{{-- Filters --}}
Event Type
Status
Device @foreach($devices as $device) @endforeach
Date From
Date To
Status
Clear Filters
Showing {{ $events->count() }} of {{ $events->total() }} events
{{-- Events List --}}
Recent Events @if($events->count() > 0)
@foreach($events as $event)
{{-- Event Icon --}}
@php $eventSeverity = $this->getEventSeverity($event->type); $iconClass = match($eventSeverity) { 'critical' => 'bg-red-500 text-white', 'warning' => 'bg-yellow-500 text-white', 'info' => 'bg-blue-500 text-white', default => 'bg-gray-500 text-white' }; $icon = match($event->type) { 'geofenceEnter', 'geofenceExit' => 'map-pin', 'alarm' => 'exclamation-triangle', 'ignitionOn', 'ignitionOff' => 'key', 'maintenance' => 'wrench-screwdriver', 'textMessage' => 'chat-bubble-left', 'driverChanged' => 'user', default => 'bell' }; @endphp
{{-- Event Title --}}

{{ ucfirst(str_replace(['geofence', 'ignition'], ['Geofence ', 'Ignition '], $event->type)) }} @if(!$event->acknowledged) New @endif

{{ $event->device->name }} - {{ $event->event_time->format('M j, Y H:i') }}

{{-- Device & Time --}}

{{ $event->device->name ?? 'Unknown Device' }}

{{ $event->event_time->diffForHumans() }}

{{ $event->event_time->format('M j, Y H:i') }}

{{-- Additional Event Details --}} @if($event->geofence || $event->position)
@if($event->geofence) {{ $event->geofence->name }} @endif @if($event->position) {{ number_format($event->position->latitude, 6) }}, {{ number_format($event->position->longitude, 6) }} @endif
@endif
{{-- Actions --}}
@if(!$event->acknowledged) @endif @if($event->position) @endif
@endforeach
{{-- Pagination --}}
{{ $events->links() }}
@else

No events found

@if($this->hasActiveFilters()) Try adjusting your filters to see more events. @else Events will appear here when devices generate alerts or notifications. @endif

@endif
{{-- Event Details Modal --}} @if($selectedEvent)
@php $eventSeverity = $this->getEventSeverity($selectedEvent->type); $iconClass = match($eventSeverity) { 'critical' => 'bg-red-500 text-white', 'warning' => 'bg-yellow-500 text-white', 'info' => 'bg-blue-500 text-white', default => 'bg-gray-500 text-white' }; @endphp
Event Details
Type: {{ ucfirst($selectedEvent->type) }}
Severity: {{ ucfirst($eventSeverity) }}
Device: {{ $selectedEvent->device->name ?? 'Unknown' }}
Time: {{ $selectedEvent->event_time->format('M j, Y H:i:s') }}
@if($selectedEvent->geofence)
Geofence: {{ $selectedEvent->geofence->name }}
@endif @if($selectedEvent->position)
Location: {{ number_format($selectedEvent->position->latitude, 6) }}, {{ number_format($selectedEvent->position->longitude, 6) }}
@endif
Message:

{{ $selectedEvent->message }}

@if($selectedEvent->attributes && count($selectedEvent->attributes) > 0)
Additional Data:
{{ json_encode($selectedEvent->attributes, JSON_PRETTY_PRINT) }}
@endif
@if(!$selectedEvent->acknowledged) Acknowledge @endif @if($selectedEvent->position) Show on Map @endif Close
@endif