@extends('layouts.admin') @php $currencySymbol = App\Models\AppSetting::getValue('currency_symbol', '?'); $currencyDecimals = App\Models\AppSetting::currencyDecimals(); $currencyStep = number_format(1 / pow(10, $currencyDecimals), $currencyDecimals, '.', ''); @endphp @section('title', 'Driver Details') @section('header', 'Driver Details') @section('content')
Total Orders
{{ $driver->total_orders ?? 0 }}
Total Earnings
{{ $currencySymbol }}{{ number_format($driver->total_earnings ?? 0, App\Models\AppSetting::currencyDecimals()) }}
Wallet Balance
{{ $currencySymbol }}{{ number_format($wallet->balance ?? 0, App\Models\AppSetting::currencyDecimals()) }}
Active Orders
{{ $driver->active_orders_count ?? 0 }}/{{ $driver->effective_max_active_orders ?? $globalMaxActiveOrders }}
Personal Information
{{ $driver->name }}
@if($driver->is_active) Active @else Inactive @endif
{{ $driver->email }}
{{ $driver->phone }}
{{ $driver->created_at->format('d M Y') }}
{{ $driver->updated_at->format('d M Y H:i') }}
Vehicle Information
{{ ucfirst($driver->vehicle_type ?? 'N/A') }}
{{ $driver->vehicle_number ?? 'N/A' }}
{{ $driver->license_number ?? 'N/A' }}
@if($driver->max_active_orders) {{ $driver->max_active_orders }} (Individual) @else Global Setting @endif
Payout Details
@php $hasAccountHolder = filled($driver->account_holder_name); $hasGatewayAccount = filled($driver->gateway_account_id) || filled($driver->stripe_account_id); $hasBankAccount = filled($driver->bank_name) && filled($driver->account_number) && filled($driver->ifsc_code); $hasUpi = filled($driver->upi_id); $isPayoutReady = $hasAccountHolder && ($hasGatewayAccount || $hasBankAccount || $hasUpi); @endphp
@if($isPayoutReady) Ready @elseif($hasAccountHolder || $hasGatewayAccount || $hasBankAccount || $hasUpi) Partial @else Missing @endif

{{ $driver->account_holder_name ?? '—' }}
{{ $driver->bank_name ?? '—' }}
{{ $driver->account_number ? '**** ' . substr($driver->account_number, -4) : '—' }}
{{ $driver->ifsc_code ?? '—' }}
{{ $driver->upi_id ?? '—' }}
{{ $driver->stripe_account_id ?? $driver->gateway_account_id ?? '—' }}
Order History (Last 20)
View All
@forelse($orders as $order) @empty @endforelse
Order ID Store Customer Amount Delivery Fee Status Date
#{{ $order->order_number }}
{{ $order->restaurant->name ?? 'N/A' }}
{{ $order->customer_name ?? 'N/A' }}
{{ $order->customer_phone ?? 'N/A' }}
{{ $currencySymbol }}{{ number_format($order->total ?? 0, App\Models\AppSetting::currencyDecimals()) }} {{ $currencySymbol }}{{ number_format($order->delivery_fee ?? 0, App\Models\AppSetting::currencyDecimals()) }} @php $statusClass = [ 'pending' => 'warning', 'confirmed' => 'info', 'preparing' => 'info', 'ready' => 'primary', 'on_the_way' => 'info', 'delivered' => 'success', 'cancelled' => 'danger', 'returned' => 'danger', ][$order->status] ?? 'secondary'; @endphp {{ ucfirst(str_replace('_', ' ', $order->status)) }} {{ $order->created_at->format('d M Y H:i') }}
No orders found
Wallet
Available Balance
{{ $currencySymbol }}{{ number_format($wallet->balance ?? 0, App\Models\AppSetting::currencyDecimals()) }}
Locked Balance
{{ $currencySymbol }}{{ number_format($wallet->locked_balance ?? 0, App\Models\AppSetting::currencyDecimals()) }}
Total Balance
{{ $currencySymbol }}{{ number_format(($wallet->balance ?? 0) + ($wallet->locked_balance ?? 0), App\Models\AppSetting::currencyDecimals()) }}

Wallet Status
Account Status
@if($wallet->is_active ?? true) Active @else Inactive @endif

Currency
{{ $wallet->currency ?? 'USD' }}

Created
{{ $wallet->created_at ? $wallet->created_at->format('d M Y H:i') : '—' }}
Wallet History (Last 10)
View All
@forelse($walletTransactions as $transaction) @empty @endforelse
@php $typeIcon = [ 'credit' => 'fa-arrow-down text-success', 'debit' => 'fa-arrow-up text-danger', 'refund' => 'fa-undo text-warning', 'topup' => 'fa-plus-circle text-info', ][$transaction->type] ?? 'fa-exchange text-secondary'; @endphp {{ ucfirst($transaction->type) }}
{{ $transaction->created_at->format('d M Y H:i') }}
@php $amountClass = in_array($transaction->type, ['credit', 'refund', 'topup']) ? 'text-success' : 'text-danger'; $amountSign = in_array($transaction->type, ['credit', 'refund', 'topup']) ? '+' : '-'; @endphp
{{ $amountSign }}{{ $currencySymbol }}{{ number_format(abs($transaction->amount), App\Models\AppSetting::currencyDecimals()) }}
No transactions