@extends('layouts.app') @section('title', 'User Details') @php use Illuminate\Support\Facades\Storage; @endphp @section('content')

User Details

View user information and permissions
Basic Information

{{ $user->name }}

{{ $user->email }}

{{ $user->phone ?? 'Not provided' }}

{{ ucfirst($user->role) }}

{{ ucfirst($user->status) }}

{{ $user->is_active ? 'Active' : 'Inactive' }}

@if($user->branch)

{{ $user->branch->name }}
{{ $user->branch->code }}

@endif

{{ $user->created_at->format('M d, Y \a\t h:i A') }}

{{ $user->address ?? 'Not provided' }}

@if($user->last_login_at)

{{ $user->last_login_at->format('M d, Y \a\t h:i A') }}

@endif

{{ $user->updated_at->format('M d, Y \a\t h:i A') }}

System Information

{{ $user->id }}

{{ $user->created_at->diffForHumans() }}

{{ $user->menus()->count() }} Menus

{{ $user->userPermissions->where('is_granted', true)->count() }} Granted {{ $user->userPermissions->where('is_granted', false)->count() }} Denied

@if($user->last_login_at)

{{ $user->last_login_at->diffForHumans() }}

@endif

@if($user->profile_photo) Uploaded @else Default @endif

Profile Photo
@php $hasPhoto = false; $photoUrl = ''; if($user->profile_photo) { // Try to check if file exists try { if(Storage::disk('public')->exists($user->profile_photo)) { $hasPhoto = true; $photoUrl = Storage::disk('public')->url($user->profile_photo); } } catch (\Exception $e) { // File doesn't exist or error checking $hasPhoto = false; } } @endphp @if($hasPhoto) {{ $user->name }} @else
@endif @if($user->profile_photo) Photo path: {{ $user->profile_photo }} @endif
User Permissions
@if($user->userPermissions->count() > 0)
Granted Permissions
@foreach($user->userPermissions->where('is_granted', true) as $userPermission)
{{ $userPermission->permission->permission_key }}
@endforeach
Denied Permissions
@foreach($user->userPermissions->where('is_granted', false) as $userPermission)
{{ $userPermission->permission->permission_key }}
@endforeach
@else

No permissions assigned.

@endif
Quick Actions
@if($user->trashed())
@csrf
@else @endif
@endsection @section('scripts') @endsection