@extends('layouts.admin', [ 'title' => 'Staff', 'pageTitle' => 'Staff', 'active' => 'staff', ]) @php $statusVariants = [ 'available' => 'success', 'busy' => 'warning', 'off_today' => 'muted', 'inactive' => 'danger', ]; $sortOptions = [ 'name' => 'Name', 'newest' => 'Newest', 'appointments_desc' => 'Most Appointments', ]; $hasActiveFilters = collect($filters ?? [])->filter()->isNotEmpty(); @endphp @section('content')

Manage staff profiles, availability, working hours, and assigned services.

Add Staff
@if (session('status'))
{{ session('status') }}
@endif

Total Staff

{{ $stats['total'] }}

Profiles in this business

Available Now

{{ $stats['available'] }}

Ready for bookings

Today Appointments

{{ $stats['today_appointments'] }}

Across all staff

Avg Rating

{{ $stats['average_rating'] }}

{{ $stats['average_rating'] === 'N/A' ? 'Ratings not collected yet' : 'From saved staff ratings' }}

Filter @if ($hasActiveFilters) Reset @endif
@if ($staffMembers->isNotEmpty())
@foreach ($staffMembers as $member) @php $availabilityKey = $member->status === 'inactive' ? 'inactive' : $member->availability_status; $openDays = $member->workingHours->where('is_closed', false)->count(); @endphp
@if ($member->avatar_url) {{ $member->name }} @else
{{ $member->initials }}
@endif

{{ $member->name }}

{{ $member->role ?: 'Staff Member' }}

{{ $member->availability_label }}

Today

{{ $member->today_appointments_count }}

Month

{{ $member->month_appointments_count }}

Phone

{{ $member->phone ?: 'No phone' }}

Hours

{{ $openDays }} days/week

View Edit Hours
@endforeach
@else

No staff found

{{ $hasActiveFilters ? 'No staff profiles match the current filters.' : 'Add staff profiles so customers can choose providers while booking.' }}

Add Staff
@endif
@endsection