@extends('layouts.app') @section('title', 'الموظفون') @php $roleMeta = [ 'owner' => ['label' => 'مالك', 'color' => 'primary', 'icon' => 'crown'], 'doctor' => ['label' => 'طبيب', 'color' => 'info', 'icon' => 'stethoscope'], 'receptionist' => ['label' => 'استقبال', 'color' => 'success', 'icon' => 'phone'], 'nurse' => ['label' => 'تمريض', 'color' => 'purple', 'icon' => 'heart'], 'accountant' => ['label' => 'محاسب', 'color' => 'warning', 'icon' => 'calculator'], 'lab_technician' => ['label' => 'فني تحاليل', 'color' => 'cyan', 'icon' => 'flask'], ]; $totalStaff = $staff->total(); $byRole = collect($staff->items())->groupBy('role')->map->count(); @endphp @section('content') @can('staff.create') @endcan

فريق العيادة

@if($staff->isEmpty())

لا يوجد موظفون بعد

أضف الأطباء والاستقبال وباقي الفريق.

@else
@foreach($staff as $u) @php $rm = $roleMeta[$u->role] ?? ['label' => $u->role, 'color' => 'secondary', 'icon' => 'user']; $initials = collect(preg_split('/\s+/u', trim($u->name))) ->filter()->take(2) ->map(fn ($w) => mb_substr($w, 0, 1)) ->implode('') ?: '؟'; $avatarRoleClass = match($u->role) { 'doctor' => 'role-doctor', 'nurse' => 'role-nurse', default => '', }; @endphp @endforeach
الموظف الدور التخصص الحالة الإجراءات
{{ $initials }}
{{ $u->name }}
{{ $u->email }}
@if($u->phone)
{{ $u->phone }}
@endif
{{ $rm['label'] }} {{ $u->specialization ?: '—' }} @if($u->status === 'active') نشط @else {{ $u->status }} @endif
@if($u->role === 'doctor' && (auth('web')->user()?->isOwner() || auth('web')->id() === $u->id)) @endif @can('staff.update') @endcan @can('staff.delete') @endcan
@if($staff->hasPages()) @endif @endif
@csrf
@endsection @push('scripts') @endpush