fix:edit sidebar and tourcontroller

This commit is contained in:
2026-08-17 18:50:59 +03:30
parent 5ccdfd65bf
commit c49e47d810
2 changed files with 218 additions and 58 deletions
+19
View File
@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Enums\CommentStatus;
use App\Enums\FlightStatus;
use App\Enums\TourStatus;
use App\Models\Tour;
@@ -21,4 +22,22 @@ class TourController extends Controller
return view('tours.index', compact('tours'));
}
public function show(Tour $tour)
{
abort_if($tour->status !== TourStatus::ENABLE->value, 404);
$tour->increment('views');
$tour->load([
'file',
'comments' => function ($query) {
$query->where('status', CommentStatus::APPROVED)
->with('user')
->orderByDesc('created_at');
},
]);
return view('tours.show', compact('tour'));
}
}