@extends('layouts.app') @section('title', 'User Details') @section('page-title', 'User Details') @section('content') View user account information, assigned role, and system access permissions. {{-- Page Actions --}}
@php $role = $user->roles->first(); $roleClasses = match ($role?->name) { 'Super Admin' => 'bg-purple-50 text-purple-700', 'Admin' => 'bg-sky-50 text-sky-700', 'Teacher' => 'bg-emerald-50 text-emerald-700', 'Parent' => 'bg-amber-50 text-amber-700', 'Student' => 'bg-indigo-50 text-indigo-700', default => 'bg-background text-muted', }; /* |-------------------------------------------------------------------------- | Effective Permissions |-------------------------------------------------------------------------- | | getAllPermissions() includes permissions inherited through roles | as well as any direct permissions assigned to the user. | */ $permissions = $user ->getAllPermissions() ->sortBy('name') ->values(); /* |-------------------------------------------------------------------------- | Group Permissions |-------------------------------------------------------------------------- | | Example: | | students.view | students.create | | becomes: | | students | view | create | */ $groupedPermissions = $permissions->groupBy( function ($permission) { return explode( '.', $permission->name, 2 )[0]; } ); @endphp {{-- User Information --}}{{ $user->email }}
Full Name
{{ $user->name }}
Email Address
{{ $user->email }}
Assigned Role
Account Status
Email Verification
Verified At
{{ $user->email_verified_at ? $user->email_verified_at->format('d M Y, h:i A') : '—' }}
Created At
{{ $user->created_at?->format('d M Y, h:i A') ?? '—' }}
Last Updated
{{ $user->updated_at?->format('d M Y, h:i A') ?? '—' }}
Assigned Roles
{{ $user->roles->count() }}
Effective Permissions
{{ $permissions->count() }}
Account
{{ $user->is_active ? 'Active' : 'Inactive' }}
The role assigned to this user controls their system access.
{{ $role->name }}
{{ $role->permissions->count() }} {{ Str::plural( 'permission', $role->permissions->count() ) }} assigned
This user currently has no system role assigned.
Permissions currently available to this user through their assigned role.
{{ $modulePermissions->count() }} {{ Str::plural( 'permission', $modulePermissions->count() ) }}
This user does not currently have any effective system permissions. Assign an appropriate role to provide system access.
This user's effective permissions are determined by the assigned role. Permission changes should normally be managed through Role Management so access remains consistent between users with the same responsibilities.
This account has the highest administrative role. Changes to its role, status, or account access should be made carefully.