@extends('layouts.public') @section('content') @php /** * Customer "My reviews" — the reviews this customer has written, newest first. * Reviews are per delivered order, created either from the order's "Leave a review" * form (AccountController::saveReview) or from a restaurant's page after a delivered * order (App\Http\Controllers\Public\ReviewController); this page lists them and links back. * @var array $reviews rows of [id, rating, comment, status, created_at, restaurant_name, restaurant_slug, order_number] */ $reviews = $reviews ?? []; @endphp

{{ t_raw('account.my_reviews') }}

@php /* The page's messages belong UNDER its title band, inside the page the reader is looking at — not floating above it. getFlashes() consumes, so the layout's own call further out finds nothing and does not draw it twice. */ @endphp
@partial('flash')
@partial('account-nav')

{{ t_raw('account.your_reviews_title') }}

@if ($reviews)
@foreach ($reviews as $rv) @php $rating = max(1, min(5, (int) $rv['rating'])); $rid = (int) $rv['id']; @endphp
{!! restaurant_logo_html(['logo' => $rv['restaurant_logo'] ?? '', 'name' => $rv['restaurant_name']], 'sm') !!} {{ $rv['restaurant_name'] }} {!! rating_stars_html((float) $rating) !!}

{{ (string) $rv['comment'] }}

{!! fmt_day($rv['created_at']) !!}@if (!empty($rv['order_number'])) · {{ (string) $rv['order_number'] }}@endif @if (($rv['status'] ?? 'approved') !== 'approved') {{ status_label('review', $rv['status']) }}@endif
@csrf
@endforeach
@else

{{ t_raw('account.no_reviews_empty') }}

{{ t_raw('restaurant.browse') }}
@endif
@if ($reviews) @endif @endsection