@php $inputClass = 'w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-white shadow-sm focus:border-primary-500 focus:ring-1 focus:ring-primary-500 transition'; $labelClass = 'block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5'; $statusColors = [ 'active' => 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400', 'inactive' => 'bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400', 'suspended' => 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400', 'pending' => 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400', ]; @endphp
{{-- Header --}}

Users Management

Create, edit, assign roles and manage user accounts.

Create User
{{-- Search & Filters --}}
{{-- Users Table --}}
@forelse($users as $user) @empty @endforelse
# User Role Status Last Seen Joined Actions
@if(is_object($users) && method_exists($users, 'currentPage')){{ ($users->currentPage() - 1) * $users->perPage() + $loop->iteration }}@else{{ $loop->iteration }}@endif
{{ $user['name'] }}
{{ $user['email'] }}
@if(($user['role'] ?? null) === 'org-admin') @elseif($user['role']) {{ str_replace('-', ' ', ucfirst($user['role'])) }} @else @endif @php $sColor = $statusColors[$user['status'] ?? ''] ?? 'bg-gray-100 text-gray-600'; @endphp {{ ucfirst($user['status'] ?? 'unknown') }} @if($user['is_online'] ?? false) Online @elseif($user['last_seen_human'] ?? null) {{ $user['last_seen_human'] }} @else Never @endif {{ $user['created_at'] ?? '—' }}
@if(($user['status'] ?? '') === 'suspended') @else @endif @if(($user['role'] ?? null) === 'org-admin') @endif

No users found.

@if(is_object($users) && method_exists($users, 'links'))
{{ $users->links() }}
@endif
{{-- Create/Edit User Modal --}} @if($showCreateModal || $showEditModal)

{{ $showCreateModal ? 'Create User' : 'Edit User' }}

@error('formName')

{{ $message }}

@enderror
@error('formEmail')

{{ $message }}

@enderror
@error('formPassword')

{{ $message }}

@enderror
{{ $showCreateModal ? 'Create User' : 'Update User' }}
@endif {{-- View User Modal --}} @if($showViewModal && $viewUser)

User Details

Name

{{ $viewUser['name'] }}

Email

{{ $viewUser['email'] }}

Role

{{ $viewUser['role'] }}

Status

@php $vColor = $statusColors[$viewUser['status'] ?? ''] ?? 'bg-gray-100 text-gray-600'; @endphp{{ ucfirst($viewUser['status']) }}

Email Verified

{{ $viewUser['email_verified'] }}

Joined

{{ $viewUser['created_at'] }}

@endif {{-- Suspend Confirmation Modal (Professional Popup) --}} @if($showSuspendModal)

Suspend User Account

You are about to suspend:

{{ $suspendUserName }}

This will immediately prevent the user from logging in and accessing any platform features. You can reactivate the account at any time.

@endif {{-- Organization Quick View Modal (for Org Admins) --}} @if($showOrgModal && $viewOrg)

Organization

Name

{{ $viewOrg['name'] }}

Status

{{ ucfirst($viewOrg['status'] ?? 'unknown') }}

Plan

{{ $viewOrg['plan'] ?? '—' }}

@endif {{-- Revoke Organization Confirmation Modal --}} @if($showRevokeOrgModal)

Suspend Organization

You are about to suspend the organization:

{{ $revokeOrgName }}

This will suspend the organization account and mark its published courses as archived/inactive. Users belonging to the organization will see that the organization account is suspended.

@endif