@extends('layouts.app') @section('title', $user->name) @section('content') {{-- META CARDS --}}
Role
@php $rc=['admin'=>'danger','manager'=>'primary','accountant'=>'info','hr'=>'purple','sales'=>'success','purchase'=>'warning','warehouse'=>'secondary','readonly'=>'secondary']; @endphp {{ ucfirst($user->role) }}
Status
{{ $user->is_active?'Active':'Inactive' }}
Last Login
{{ $user->last_login_at ? $user->last_login_at->format('d M Y H:i') : 'Never' }}
@if($user->last_login_at)
{{ $user->last_login_at->diffForHumans() }}
@endif
Member Since
{{ $user->created_at->format('d M Y') }}
{{ $user->created_at->diffForHumans() }}
{{-- RECENT ACTIVITY --}}
Recent ActivityLast 30 actions
@forelse($recentActivity as $log)
{{ $log->description }}
{{ $log->created_at->format('d M Y H:i') }} · {{ $log->ip_address }}
{{ ucfirst($log->action) }}
@empty
No activity recorded yet
@endforelse
{{-- LOGIN HISTORY --}}
{{-- RESET PASSWORD --}}
Reset Password
@csrf @method('PATCH')
{{-- LOGIN SESSIONS --}}
Login History
@forelse($loginHistory as $h)
{{ $h->browser ?? 'Unknown' }} · {{ ucfirst($h->device_type ?? 'desktop') }}
@if($h->is_active)Active @else{{ $h->session_duration }}@endif
{{ $h->ip_address }} · {{ $h->logged_in_at->format('d M Y H:i') }}
@empty
No login records
@endforelse
{{-- PERMISSIONS --}}
Module Permissions — {{ ucfirst($user->role) }} RoleChanges apply to all {{ $user->role }} users
@csrf @method('PATCH')
@php $mods=['accounting'=>'Accounting','sales'=>'Sales','purchase'=>'Purchase','inventory'=>'Inventory','hr'=>'HR & Payroll','pos'=>'Point of Sale','crm'=>'CRM','banking'=>'Banking','tax'=>'Tax Compliance','manufacturing'=>'Manufacturing','reports'=>'Reports','settings'=>'Settings']; @endphp @foreach($mods as $key => $label) @php $perm = $permissions[$key] ?? null; @endphp @foreach(['view','create','edit','delete','submit'] as $ability) @endforeach @endforeach
ModuleViewCreateEditDeleteSubmit/Approve
{{ $label }} {'can_'.$ability}) || $user->role==='admin' ? 'checked' : '' }} {{ $user->role==='admin' ? 'disabled' : '' }} style="width:16px;height:16px;accent-color:var(--primary)">
@if($user->role !== 'admin') @else @endif
@endsection