@extends('layouts.admin') @section('title', $user->displayName()) @section('content') @php $accountStatus = \App\Models\Status::find_($user->account_status_id); @endphp
{{ strtoupper(mb_substr($user->displayName(), 0, 1)) }}

{{ $user->displayName() }} @include('partials.status', ['status' => $accountStatus])

User #{{ $user->id }} · joined {{ ist($user->created_at, 'd M Y') }} · last sign-in {{ ist($user->last_login_at) }}
@include('partials.actions', ['actions' => $accountActions, 'route' => route('admin.users.status', $user), 'id' => 'acct']) @if ($accountStatus?->code === 'deletion_requested') @can('user.delete')
@csrf
@endcan @endif
@if ($user->suspended_at)
Suspended {{ ist($user->suspended_at) }} — {{ $user->suspension_reason }}
@endif @if ($user->deletion_requested_at && ! $user->anonymized_at)
The user asked for their account to be deleted on {{ ist($user->deletion_requested_at) }}.
@endif
Account
Mobile
{{ $user->fullPhone() ?? '—' }} @if ($user->phone_verified_at)@endif
Email
{{ $user->email ?? '—' }}
Language
{{ $user->preferredLanguage?->native_name ?? '—' }}
Location
{{ collect([$user->profile?->primaryAddress?->district?->name, $user->profile?->primaryAddress?->state?->name])->filter()->join(', ') ?: '—' }}
Referral code
{{ $user->referral_code ?? '—' }}
Terms accepted
{{ ist($user->terms_accepted_at) }} {{ $user->terms_version ? '(v'.$user->terms_version.')' : '' }}
Onboarding
{{ $user->profile_completed_at ? 'Profile complete' : humanize($user->onboarding_step ?? 'not started') }}
Roles
    @forelse ($user->userRoles as $ur)
  • {{ $ur->role?->name }} @if ($ur->is_primary)primary@endif @if ($ur->approved_at)
    approved {{ ist($ur->approved_at, 'd M Y') }} {{ $ur->approvedBy ? 'by '.$ur->approvedBy->displayName() : '' }}
    @endif
    @include('partials.status', ['status' => $ur->status_id]) @can('role.approve') @include('partials.actions', ['actions' => app(\App\Services\StatusService::class)->availableActions('user_role', $ur->status_id, auth()->user()), 'route' => route('admin.user-roles.status', $ur), 'id' => 'ur'.$ur->id]) @endcan
  • @empty
  • No roles chosen yet.
  • @endforelse
@foreach ($roleProfiles as $label => $p) @continue(! $p)
{{ $label }} profile
@foreach (collect($p->getAttributes())->except(['id', 'user_id', 'created_at', 'updated_at']) as $k => $v) @continue($v === null || str_ends_with($k, '_hash'))
{{ humanize(preg_replace('/_id$/', '', $k)) }}
@switch($k) @case('farming_type_id') {{ $p->farmingType?->label }} @break @case('buyer_type_id') {{ $p->buyerType?->label }} @break @case('business_type_id') {{ $p->businessType?->label }} @break @case('transport_operator_id') {{ $p->operator?->name }} @break @case('consultation_fee') {{ inr($v) }} @break @case('licence_number_last4') ••••{{ $v }} @break @default {{ is_bool($v) ? ($v ? 'Yes' : 'No') : $v }} @endswitch
@endforeach
@endforeach
@include('users.partials.documents', ['documents' => $user->documents])
Recent listings
@forelse ($listings as $l) @empty @endforelse
{{ $l->displayTitle() }}{{ $l->listingType->name }} {{ inr($l->price_amount) }}@include('partials.status', ['status' => $l->status_id])
No listings.
Recent transport bookings
@forelse ($bookings as $b) @empty @endforelse
{{ $b->reference() }} {{ $b->pickup()?->place_name }} → {{ $b->drop()?->place_name }} {{ inr($b->estimated_total_amount) }}@include('partials.status', ['status' => $b->status_id])
No bookings.
@include('partials.history', ['history' => $history])
Admin actions on this account
    @forelse ($audit as $a)
  • {{ $a->event }} by {{ $a->actor?->displayName() ?? 'system' }}{{ ist($a->created_at) }}
  • @empty
  • None.
  • @endforelse
@endsection