feat:compele comments for dashboard side

This commit is contained in:
2026-08-18 12:41:56 +03:30
parent bee7587f2c
commit d6e3b20557
4 changed files with 121 additions and 1 deletions
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Controllers\Account;
use App\Http\Controllers\Controller;
use App\Models\Comment;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class CommentStatusController extends Controller
{
public function index()
{
$comments = Comment::with([
'flight.departureAirport.city',
'flight.arrivalAirport.city',
'tour',
])
->where('user_id', Auth::id())
->latest()
->paginate(10);
return view('account.comments', compact('comments'));
}
}
@@ -31,6 +31,7 @@ class CommentController extends Controller
$data = $request->validated();
Comment::create([
'tour_id' => $tour->id,
'user_id' => auth()->id(),
'guest_name' => auth()->guest() ? $data['guest_name'] : null,
@@ -41,5 +42,7 @@ class CommentController extends Controller
return back()->with('success', 'نظر شما ثبت شد.');
}
}