{{ __('Dashboard') }}

Today Trips
{{ $todayTrips }}
Today Income
₹{{ number_format($todayIncome, 2) }}
Fuel Expense
₹{{ number_format($fuelExpense, 2) }}
Today Profit
₹{{ number_format($profit, 2) }}

Pending Payments

Total outstanding balance from trips.

₹{{ number_format($pendingPayments, 2) }}
⚠️ Expiry Alerts (Next 30 Days) {{ $expiryAlerts->count() }}
@if($expiryAlerts->isEmpty())

No upcoming expiries. ✅

@else
    @foreach($expiryAlerts as $alert)
  • {{ $alert->vehicle->vehicle_number ?? 'Unknown' }}

    {{ $alert->expiry_type }}

    {{ \Carbon\Carbon::parse($alert->expiry_date)->format('d M Y') }}

    {{ \Carbon\Carbon::parse($alert->expiry_date)->diffForHumans() }}

  • @endforeach
@endif
🚛 Recent Trips Last 5
@if($recentTrips->isEmpty())

No trips recorded yet.

@else
    @foreach($recentTrips as $trip)
  • {{ $trip->location }}

    {{ $trip->vehicle->vehicle_number ?? '' }} • {{ $trip->driver->driver_name ?? '' }}

    ₹{{ number_format($trip->rent_amount, 0) }}

    {{ $trip->date->format('d M Y') }}

  • @endforeach
@endif

🏆 Top Vehicles (Last 30 Days) By Profit

@if($topVehiclesQuery->isEmpty())

No data available yet.

@else @php $maxProfit = $topVehiclesQuery->max('total_profit') > 0 ? $topVehiclesQuery->max('total_profit') : 1; @endphp
@foreach($topVehiclesQuery as $tv) @php $percentage = min(100, max(0, ($tv->total_profit / $maxProfit) * 100)); @endphp
{{ $tv->vehicle->vehicle_number ?? 'Unknown' }} ₹{{ number_format($tv->total_profit, 2) }}
Rent: ₹{{ number_format($tv->total_rent, 0) }} Fuel: ₹{{ number_format($tv->total_fuel, 0) }}
@endforeach
@endif

📈 Business Overview

@if($profitData->isEmpty())

No data for last 30 days.

@else @php $maxVal = max($profitData->max('rent'), 1); @endphp
@foreach($profitData as $week) @php $rentH = max(5, ($week->rent / $maxVal) * 100); $fuelH = max(3, ($week->fuel / $maxVal) * 100); @endphp
@endforeach
Income Fuel
@endif