@extends('layouts.app') @section('title', 'Movement History') @section('content')

Movement History

@if(auth()->user()->hasPermission('scanning.perform')) New Scan @endif
@php($filterOfficer = $selectedOfficerId ? ($officers->firstWhere('id', (int) $selectedOfficerId) ?? \App\Models\CheckpointOfficer::find($selectedOfficerId)) : null) @if($filterOfficer)
Showing movement history for officer {{ $filterOfficer->full_name }} ({{ $filterOfficer->officer_code }})
Clear filter
@endif
Reset
@forelse($scans as $scan) @empty @endforelse
Scanned Plate Vehicle Checkpoint Officer Direction Result Clearance Actions
{{ $scan->scanned_at?->format('d M Y h:i A') }} {{ $scan->license_plate ?? '-' }} {{ $scan->vehicle?->make }} {{ $scan->vehicle?->model }} {{ $scan->checkpoint?->name ?? '-' }} {{ $scan->officer?->full_name ?? '-' }} {{ ucfirst($scan->direction) }} @php($rc = $scan->verification_result === 'cleared' ? 'success' : (in_array($scan->verification_result, ['flagged','passage_denied']) ? 'danger' : 'warning')) {{ ucwords(str_replace('_', ' ', $scan->verification_result)) }} @php($cc = $scan->clearance_status === 'cleared' ? 'success' : ($scan->clearance_status === 'revoked' ? 'danger' : 'warning')) {{ ucfirst($scan->clearance_status) }} @if($scan->clearance?->notes)
{{ $scan->clearance->notes }}
@endif @if($scan->clearance?->cleared_at)
{{ $scan->clearance->cleared_at->format('d M Y H:i') }}
@endif
@php($canOperate = !($restrictedOfficer ?? false) || $scan->checkpoint_id === ($assignedCheckpointId ?? null)) @if($canOperate && $scan->clearance_status !== 'cleared' && auth()->user()->hasPermission('scanning.clearance'))
@csrf
@endif @if($canOperate && $scan->clearance_status === 'cleared' && auth()->user()->hasPermission('scanning.revoke_clearance'))
@csrf
@endif
No scans found.
{{ $scans->links() }}
@endsection