@extends('Layout.mainlayout') @section('content')

Policies Management

📋
Total policies
{{ $total_policies }}
📄
Total Active Policies
{{ $active_policies }}
📄
Total Pending Policies
{{ $pending_policies }}

Policies History ({{ $vehicles->count() }})

@forelse($vehicles as $vehicle)
Policy No: {{ $vehicle->policy_no ?? 'N/A' }}
{{ ucfirst($vehicle->status ?? 'Pending') }}
Name
{{ $vehicle->customer->title ?? 'N/A' }} {{ $vehicle->customer->fname ?? 'N/A' }} {{ $vehicle->customer->lname ?? 'N/A' }}
Email
{{ $vehicle->customer->email ?? 'N/A' }}
Start Date
{{ $vehicle->created_at->format('d/m/Y') }}
@if($vehicle->expiry_date)
Policy Due Date: {{ \Carbon\Carbon::parse($vehicle->expiry_date)->format('M d Y') }} ({{ \Carbon\Carbon::parse($vehicle->expiry_date)->diffInDays(now()) }} days Left)
@endif
@empty

No policies found

Try adjusting your search or filter criteria

@endforelse
@endsection