@extends('layouts.admin') @section('title', 'User Details') @section('content') @php($canManage = auth()->user()?->hasPermission('users', 'manage')) @php($isStaff = in_array($user->role, ['admin', 'manager', 'staff'], true))

{{ $isStaff ? 'Staff Details' : 'Customer Details' }}

{{ $user->name }} · {{ $user->mobile }}

Back
Profile
Name: {{ $user->name }}
Mobile: {{ $user->mobile }}
Email: {{ $user->email ?? '—' }}
Type: {{ ucfirst($user->role) }}
Status: {{ ucfirst($user->status ?? 'active') }}
Assigned Role: @if($user->role === 'admin') Super Admin @elseif($user->assignedRole) {{ $user->assignedRole->name }} @else — @endif
Created: {{ $user->created_at?->format('d M Y h:i A') }}
Total Leads: {{ $user->leads->count() }}
Total Payments: {{ $user->payments->count() }}
@if($canManage)
Update Account
@csrf @method('PUT')
Controls which modules this user can access.
@if(auth()->user()?->hasPermission('roles', 'view')) Manage Roles @endif
@if($user->id !== auth()->id())
@csrf @method('DELETE')
@endif
@endif @if($isStaff)
Effective Permissions
@if($user->role === 'admin')
Super Admin. Unrestricted access to every module.
@else @php($perms = (array) ($user->assignedRole?->permissions ?? $user->permissions ?? [])) @if(empty($perms))

No permissions — assign a role above to grant access.

@else
@foreach($modules as $key => $module) @php($granted = (array) ($perms[$key] ?? [])) @if(! empty($granted))
{{ $module['label'] }}
@foreach($granted as $action) {{ $action }} @endforeach
@endif @endforeach
@endif @endif
@endif
@endsection