@extends('layouts.app') @section('title', ' - ' . $cafe->nama) @section('styles') @endsection @section('content')

Detail Cafe

@php $images = $cafe->images; @endphp @if($images->count() > 0)
{{ $cafe->nama }}
@foreach($images as $idx => $image) {{ $cafe->nama }} @endforeach
@elseif($cafe->gambar) {{ $cafe->nama }} @else
@endif
@auth
@csrf
@else @endauth
@if($cafe->latitude && $cafe->longitude) Google Maps @endif

{{ $cafe->nama }}

@php $totalRating = 0; foreach($cafe->ratings as $rating) { $totalRating += $rating->subcategory->value; } $avgRating = $cafe->ratings->count() > 0 ? $totalRating / $cafe->ratings->count() : 0; $roundedRating = round($avgRating * 2) / 2; @endphp
{{ number_format($avgRating, 1) }}
@for($i = 1; $i <= 5; $i++) @if($i <=$roundedRating) @elseif($i - 0.5 <= $roundedRating) @else @endif @endfor
{{ $cafe->ratings->count() }} penilaian
@if($cafe->area)

Area: {{ $cafe->area }}

@endif

Kriteria dan Rating

@foreach($cafe->ratings as $rating) @endforeach
{{ $rating->category->name }}
@for ($i = 0; $i < $rating->subcategory->value; $i++) @endfor @for ($i = $rating->subcategory->value; $i < 5; $i++) @endfor
{{ $rating->subcategory->name }}
@endsection @section('scripts') @endsection