@extends('layouts.app') @section('title', 'Geofence Violations') @section('no-page-header') @php $pageTitle = 'Geofence Violations'; $pageSubtitle = 'Monitor and manage geofence violations'; $breadcrumbs = [ ['label' => 'Dashboard', 'url' => route('dashboard'), 'icon' => 'tachometer-alt'], ['label' => 'Geofence Violations', 'url' => ''] ]; @endphp @section('content')
Geofence Violations
{{ $violations->count() }}

Total Violations

{{ $violations->where('is_resolved', false)->count() }}

Unresolved

{{ $violations->where('is_resolved', true)->count() }}

Resolved

{{ $violations->getCollection()->filter(function($violation) { return \Carbon\Carbon::parse($violation->violation_time)->isToday(); })->count() }}

Today

@forelse($violations ?? [] as $violation) @empty @endforelse
ID Geofence Employee Type Time Location Status Actions
{{ $violation->id }} {{ $violation->geofence->name }} {{ $violation->employee->full_name }} {{ ucfirst(str_replace('_', ' ', $violation->violation_type)) }} {{ $violation->violation_time->format('M d, Y h:i A') }} {{ $violation->latitude }}, {{ $violation->longitude }} @if($violation->is_resolved) Resolved @else Unresolved @endif
@if(!$violation->is_resolved) @endif
No geofence violations found.
{{ $violations->links() }}
@endsection