{{-- Header Section --}}

User Management

Managing subscriptions, usage, and roles for system users.

{{-- DataTable Component Apply --}} {{-- Search Bar Slot --}}
{{-- 使用你的 x-text-input 组件 (修改点) --}} @if(request('search')) Clear @endif
{{-- Table Body Row Content --}} @foreach($userManagement as $user)
{{ strtoupper(substr($user->user_name ?? $user->name ?? 'U', 0, 1)) }}
{{ $user->user_name ?? $user->name }}
{{ $user->user_email ?? $user->email }}
{{ $user->role ?? 'N/A' }}
Ref: {{ $user->applied_ref_code ?? 'None' }}
@php $status = strtolower($user->subscription_status ?? 'unknown'); $color = match($status) { 'active' => 'bg-emerald-100 text-emerald-800 border-emerald-200', 'pending' => 'bg-amber-100 text-amber-800 border-amber-200', 'expired' => 'bg-rose-100 text-rose-800 border-rose-200', default => 'bg-gray-100 text-gray-800 border-gray-200', }; @endphp {{ ucfirst($status) }}
Count: {{ $user->usage_count ?? 0 }}
Disc: {{ $user->discount_rate ?? 0 }}%
{{ $user->created_at ? \Carbon\Carbon::parse($user->created_at)->format('d M, Y') : 'N/A' }} {{-- 操作列 --}}
@csrf @method('DELETE')
@endforeach