صورة المستخدم
{{ $user->name ?? '—' }}
ID: {{ $user->id }}
{{-- بطاقات سريعة للحالة والدور والفصل --}}
الحالة
@php $isActive = (bool) ($user->status ?? false); @endphp {{ $isActive ? 'نشط' : 'غير نشط' }}
الدور
@php $roleColors = [ 'admin' => 'bg-danger', 'manager' => 'bg-primary', 'trader' => 'bg-info text-dark', 'user' => 'bg-secondary', ]; $role = $user->role ?? 'user'; $roleClass = $roleColors[$role] ?? 'bg-secondary'; @endphp {{ $role }}
{{-- بطاقة الفصل --}}
الفصل الدراسي
@php $classRoom = $user->classRoom ?? null; @endphp @if ($classRoom)
{{ $classRoom->name ?? '—' }} @if (!empty($classRoom->grade)) الصف: {{ $classRoom->grade }} @endif @if (!empty($classRoom->section)) الشعبة: {{ $classRoom->section }} @endif @if (!empty($classRoom->code)) الكود: {{ $classRoom->code }} @endif
@else — @endif
معلومات أساسية
#{{ $user->id }} {{ Str::limit($user->email ?? '—', 30) }} {{ $user->phone ?? '—' }}
{{-- تفاصيل مرتبة باستخدام تعريفات وصفية --}}
بيانات الاتصال
البريد
{{ $user->email ?? '—' }}
الهاتف
{{ $user->phone ?? '—' }}
العنوان

{{ filled($user->address ?? null) ? $user->address : '—' }}

{{-- قسم تفاصيل إضافية عن الفصل (اختياري) --}} @if ($classRoom)
تفاصيل الفصل
{{-- مثال زر للانتقال لصفحة الفصل إن وجدت Route --}} @if (Route::has('classrooms.show')) صفحة الفصل @endif
الاسم
{{ $classRoom->name ?? '—' }}
@if (!empty($classRoom->grade))
الصف
{{ $classRoom->grade }}
@endif @if (!empty($classRoom->section))
الشعبة
{{ $classRoom->section }}
@endif @if (!empty($classRoom->code))
الكود
{{ $classRoom->code }}
@endif {{-- مثال لعرض اسم المعلم المرتبط بالفصل إن كانت العلاقة موجودة --}} @if (method_exists($classRoom, 'teacher') && $classRoom->relationLoaded('teacher') && $classRoom->teacher)
المعلم
{{ $classRoom->teacher->name }}
@endif
@endif
آخر تحديث: {{ optional($user->updated_at)->format('Y-m-d H:i') ?? '—' }}