Files

11 lines
689 B
PHP
Raw Permalink Normal View History

{{-- One review, from its index-shaped array (ProductIndexer::mapReview()).
Shared by the product page's list and the review-stored Turbo Stream. --}}
<x-review-card :review="[
'rating' => $review['rating'],
'name' => $review['reviewer_name'],
'date' => $review['reviewed_at'] ? \Illuminate\Support\Carbon::createFromTimestamp($review['reviewed_at'])->translatedFormat('d M Y') : '',
'text' => $review['body'],
'image' => $review['media'][0]['url'] ?? null,
'reply' => $review['reply'] ?? null,
'replyDate' => ($review['replied_at'] ?? null) ? \Illuminate\Support\Carbon::createFromTimestamp($review['replied_at'])->translatedFormat('d M Y') : null,
]" />