@extends('layouts.admin') @section('title', $user->name) @section('content')

{{ $user->name }}

@if($user->role === 'vendor')

Total Vehicles

{{ $stats['total_vehicles'] }}

Total Spare Parts

{{ $stats['total_spare_parts'] }}

Active Listings

{{ $stats['active_vehicles'] + $stats['active_spare_parts'] }}

@endif

User Information

{{ $user->name }}

{{ $user->email }}

{{ $user->phone ?? 'N/A' }}

{{ $user->address ?? 'N/A' }}

{{ ucfirst($user->role) }}
{{ $user->email_verified_at ? 'Active' : 'Inactive' }}
{{ $user->email_verified_at ? 'Verified' : 'Not Verified' }}

{{ $user->created_at->format('M d, Y') }}

@if($user->role === 'vendor' && ($user->business_name || $user->kra_pin || $user->id_number || $user->business_certificate))

Vendor Information

@if($user->business_name)

{{ $user->business_name }}

@endif @if($user->kra_pin)

{{ $user->kra_pin }}

@endif
@if($user->id_number)

{{ $user->id_number }}

@endif @if($user->business_certificate)
@endif
@endif @if($user->role === 'vendor' && ($user->vehicles->count() > 0 || $user->spareParts->count() > 0))

Recent Listings

@foreach($user->vehicles->take(3) as $vehicle)

{{ $vehicle->title }}

KSh {{ number_format($vehicle->price) }}

{{ $vehicle->is_approved ? 'Approved' : 'Pending' }}
@endforeach @foreach($user->spareParts->take(3) as $part)

{{ $part->name }}

KSh {{ number_format($part->price) }}

{{ $part->is_approved ? 'Approved' : 'Pending' }}
@endforeach
@endif

Quick Actions

Change Password @if($user->id !== auth()->id())
@csrf
@csrf @method('DELETE')
@endif

Account Information

Member Since: {{ $user->created_at->format('M d, Y') }}
Last Updated: {{ $user->updated_at->format('M d, Y') }}
Email Verified: {{ $user->email_verified_at ? $user->email_verified_at->format('M d, Y') : 'Not Verified' }}
@if($user->role === 'vendor')

Listing Statistics

Total Vehicles: {{ $stats['total_vehicles'] }}
Pending Vehicles: {{ $stats['pending_vehicles'] }}
Active Vehicles: {{ $stats['active_vehicles'] }}
Total Spare Parts: {{ $stats['total_spare_parts'] }}
Pending Parts: {{ $stats['pending_spare_parts'] }}
Active Parts: {{ $stats['active_spare_parts'] }}
@endif
@endsection