@extends('layouts.admin', [ 'title' => 'Services', 'pageTitle' => 'Services', 'active' => 'services', ]) @php $statusVariants = [ 'active' => 'success', 'inactive' => 'muted', 'draft' => 'warning', ]; $sortOptions = [ 'newest' => 'Newest', 'name' => 'Name', 'price_asc' => 'Price: Low to High', 'price_desc' => 'Price: High to Low', 'duration_asc' => 'Shortest Duration', ]; $hasActiveFilters = collect($filters ?? [])->filter()->isNotEmpty(); @endphp @section('content')

Manage bookable services, pricing, timing, buffers, and staff assignments.

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

Total Services

{{ $stats['total'] }}

Across {{ count($categories) }} categories

Active

{{ $stats['active'] }}

Visible on booking page

Average Price

${{ number_format($stats['average_price'], 0) }}

Current service catalog

Top Service

{{ $stats['top_service']?->name ?? 'No service yet' }}

{{ $stats['top_service']?->appointments_count ?? 0 }} bookings

Filter @if ($hasActiveFilters) Reset @endif
@if ($services->isNotEmpty())
@foreach ($services as $service) @php $staffNames = $service->staffProfiles->pluck('name')->join(', ') ?: 'Unassigned'; $bufferLabel = $service->buffer_before_minutes . 'm / ' . $service->buffer_after_minutes . 'm'; @endphp

{{ $service->name }}

{{ $service->category ?: 'Uncategorized' }}

{{ $service->status_label }}

Price

${{ number_format($service->price, 2) }}

Duration

{{ $service->duration_minutes }} min

Staff

{{ $staffNames }}

Buffer

{{ $bufferLabel }}

View Edit
@endforeach
@else

No services found

{{ $hasActiveFilters ? 'No services match the current filters. Reset filters or create a new service.' : 'Create your first service so customers can book from the public booking page.' }}

Add Service
@endif
@push('modals') @foreach ($services as $service) @include('admin.services.partials.delete-modal', ['service' => $service, 'modalId' => 'delete-service-modal-' . $service->id]) @endforeach @endpush @endsection