feat:complete comments in tourShow

This commit is contained in:
2026-08-17 18:20:38 -07:00
parent c070681830
commit 914c1aedbd
3 changed files with 55 additions and 7 deletions
+40 -5
View File
@@ -1,11 +1,13 @@
<div class="listing-item">
<h4 class="mb-3">بررسی‌ها</h4>
<h4 class="mb-3">بازخوردها</h4>
<div class="listing-review">
<h5>بازخوردها</h5>
@forelse($flight->comments as $comment)
@forelse($comments as $comment)
<div class="listing-review-item">
<div class="listing-review-author">
@@ -19,6 +21,7 @@
<div class="listing-review-author-info">
<div>
<h6>
@if($comment->user)
{{ $comment->user->first_name }}
@@ -32,6 +35,7 @@
<i class="far fa-clock"></i>
{{ $comment->created_at->toJalali()->format('Y/m/d') }}
</span>
</div>
</div>
@@ -40,13 +44,21 @@
<p>{{ $comment->comment }}</p>
</div>
@empty
<p>هنوز بازخوردی ثبت نشده است. اولین نفری باشید که نظر می‌دهد.</p>
<p>
هنوز بازخوردی ثبت نشده است.
اولین نفری باشید که نظر می‌دهد.
</p>
@endforelse
</div>
<div class="listing-review-form">
<h4>نظر بدهید</h4>
@error('success')
@@ -56,11 +68,21 @@
@enderror
<form action="{{ route('flights.comments', $flight) }}" method="POST">
@php
$commentRoute = $type === 'flight'
? route('flights.comments', $item)
: route('tours.comments', $item);
@endphp
<form action="{{ $commentRoute }}" method="POST">
@csrf
@guest
<div class="form-group mb-3">
<input
type="text"
name="guest_name"
@@ -68,9 +90,12 @@
placeholder="نام شما*"
value="{{ old('guest_name') }}"
>
</div>
<div class="form-group mb-3">
<input
type="email"
name="guest_email"
@@ -78,10 +103,14 @@
placeholder="ایمیل شما*"
value="{{ old('guest_email') }}"
>
</div>
@endguest
<div class="form-group">
<textarea
name="comment"
class="form-control"
@@ -89,11 +118,17 @@
rows="5"
placeholder="نظر خود را بنویسید*"
>{{ old('comment') }}</textarea>
</div>
<button class="theme-btn" type="submit">
نظر بدهید
</button>
</form>
</div>
</div>