@extends('layouts.app') @section('title', 'Tous les services - TaPrestation') @section('content')
{{-- Bannière d'en-tête --}}

Services Professionnels

Trouvez l'expert idéal pour votre projet.

{{-- Filtres compacts --}}
@include('components.filters.compact-filters', [ 'pageType' => 'services', 'themeColor' => 'blue', 'formAction' => route('services.index'), 'categories' => $categories->whereNull('parent_id') ])
{{-- Résultats --}}
@if($services->count() > 0)
@foreach($services as $service) @php $photoCount = $service->images?->count() ?? 0; $firstPhoto = $photoCount > 0 ? $service->images->first()->image_path : null; $prestataire = $service->prestataire; $prestataireName = $prestataire?->user?->name ?? $prestataire?->company_name ?? $prestataire?->first_name ?? 'Prestataire'; $canContact = auth()->check() && auth()->user()->role === 'client' && $prestataire && auth()->user()->id !== $prestataire->user_id; $showBooking = function_exists('feature_enabled') && feature_enabled('booking_payment_enabled'); $city = $service->city ?: ($prestataire?->city ?: null); $ratingAvg = $prestataire?->rating_average; $ratingCount = $prestataire?->total_reviews; @endphp
{{-- Image --}}
@if($firstPhoto) @else
@endif @if($photoCount > 1)
@for($i = 0; $i < min($photoCount, 8); $i++) @if($i === 0) @else @endif @endfor
@endif
{{-- Infos --}}
@if($service->price)
{{ number_format($service->price, 0, ',', ' ') }} €
@else
Sur devis
@endif
{{ $service->created_at->diffForHumans(null, true, true) }}
{{ $service->title }}
{{ $prestataireName }}
@if($city) Ville: {{ Str::limit($city, 18) }} @endif @if(is_numeric($ratingAvg) && (float)$ratingAvg > 0) Note: {{ number_format((float)$ratingAvg, 1, '.', '') }}@if(is_numeric($ratingCount) && (int)$ratingCount > 0) ({{ (int)$ratingCount }})@endif @endif @if(isset($service->distance_km) && $service->distance_km !== null) Distance: {{ $service->distance_km }} km @endif
@auth @if($canContact) Contacter @if($showBooking && \Illuminate\Support\Facades\Route::has('bookings.create')) {{ ($service->reservable ?? true) ? 'Réserver' : 'Demander' }} @endif @endif @else Contacter @endauth
@endforeach
@else {{-- État vide --}}

Aucun service trouvé

Essayez de modifier vos filtres ou explorez tous nos services.

Réinitialiser les filtres
@endif {{-- Pagination --}} @if($services->hasPages())
{{ $services->appends(request()->query())->links() }}
@endif
@endsection