Portatour - Reviews

<script type="application/ld+json">

export default PortaTourReviews; // Admin routes Route::get('/admin/reviews/pending', [AdminReviewController::class, 'pending']); Route::patch('/admin/reviews/id/approve', [AdminReviewController::class, 'approve']); Route::delete('/admin/reviews/id', [AdminReviewController::class, 'destroy']); Admin view filters unapproved reviews, can approve, delete, or reply. 5. SEO & Schema.org Markup Add to tour page: portatour reviews

const submitReview = async () => await fetch( /api/tours/$tourId/reviews , method: 'POST', headers: 'Content-Type': 'application/json' , body: JSON.stringify(newReview) ); // refresh reviews ; export default PortaTourReviews

return ( <div className="portatour-reviews"> <div className="reviews-header"> <h2>Customer Reviews</h2> <div className="rating-summary"> <span className="average">stats?.average_rating.toFixed(1)</span> <StarRating rating=stats?.average_rating /> <span>(stats?.total_reviews reviews)</span> </div> </div> // Admin routes Route::get('/admin/reviews/pending'

$reviews = PortaTourReview::where('tour_id', $tourId) ->where('is_approved', true) ->with('user:id,name,avatar') ->orderBy('created_at', 'desc') ->paginate(10); // Aggregate rating breakdown $stats = [ 'average_rating' => PortaTourReview::where('tour_id', $tourId) ->where('is_approved', true) ->avg('rating'), 'total_reviews' => $reviews->total(), 'rating_counts' => PortaTourReview::where('tour_id', $tourId) ->where('is_approved', true) ->selectRaw('rating, count(*) as count') ->groupBy('rating') ->pluck('count', 'rating') ];

</script> ✅ Verified purchase only (via booking ID) ✅ Star rating (1–5) + title + comment ✅ Image upload (max 5) ✅ Helpful button ✅ Admin approval workflow ✅ Average rating & breakdown ✅ Sort by newest / highest rated ✅ SEO structured data