Présentation
@foreach(explode("\n\n", $pro['description']) as $para)
{{ $para }}
@endforeach
@if($pro['services'])
Services & équipements
@foreach($pro['services'] as $s)
{{ $s }}
@endforeach
@endif
@if($pro['photos'])
Photos de l'établissement
{{ $pro['photos'] }} photos
@foreach($pro['image_urls'] as $i => $url)
@endforeach
@endif
@php
$avis = $pro->publishedReviews;
$monAvis = auth()->check() ? $avis->firstWhere('user_id', auth()->id()) : null;
$repartition = collect(range(5, 1))->mapWithKeys(fn ($n) => [
$n => $avis->count() ? round($avis->where('rating', $n)->count() / $avis->count() * 100) : 0,
]);
@endphp
Avis clients
@auth
@if($pro->user_id !== auth()->id())
@endif
@else
Laisser un avis
@endauth
@auth
@if($pro->user_id !== auth()->id())
@endif
@endauth
{{ number_format($pro['rating'], 1, ',', '') }}
@for($i = 1; $i <= 5; $i++)
@endfor
{{ $pro['reviews'] }} avis
@foreach($repartition as $note => $pct)
{{ $note }} ★
{{ $pct }}%
@endforeach
@forelse($avis as $a)
{{ $a->user->initials }}
{{ $a->user->display_name }}
@for($i = 1; $i <= 5; $i++)
@endfor
{{ $a->created_at->diffForHumans() }}
{{ $a->body }}
@if($a->reply)
Réponse de {{ $pro->name }} : {{ $a->reply }}
@endif
@empty
Aucun avis pour le moment. Soyez le premier à partager votre expérience.
@endforelse
@if($avis->count() > 5)
Voir les {{ $pro['reviews'] }} avis
@endif