Skip to content

Commit

Permalink
feat: Add Blade template for displaying product re
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Mar 11, 2024
1 parent d523840 commit 5f28e88
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions resources/views/reviews.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@extends('layouts.app')

@section('content')
<div class="container">
<h2>Product Reviews</h2>
<div class="reviews-sort-filter">
<form action="{{ url()->current() }}" method="GET">
<div class="form-group">
<label for="sort">Sort by:</label>
<select name="sort" id="sort" class="form-control">
<option value="date_desc">Date (Newest First)</option>
<option value="date_asc">Date (Oldest First)</option>
<option value="rating_desc">Rating (High to Low)</option>
<option value="rating_asc">Rating (Low to High)</option>
<option value="relevance">Relevance</option>
</select>
</div>
<button type="submit" class="btn btn-primary">Apply</button>
</form>
</div>
@if($reviews->isEmpty())
<p>No reviews yet.</p>
@else
@foreach($reviews as $review)
<div class="review">
<h4>{{ $review->author }}</h4>
<p>{{ $review->content }}</p>
<p>Rating: {{ $review->rating }} / 5</p>
<p>Date: {{ $review->created_at->toFormattedDateString() }}</p>
</div>
@endforeach
{{ $reviews->links() }}
@endif
</div>
@endsection

0 comments on commit 5f28e88

Please sign in to comment.