fix: update homepage data

This commit is contained in:
2026-08-22 07:55:32 +03:30
parent 178219b699
commit 2195f10016
+5
View File
@@ -9,6 +9,7 @@ class IndexController extends Controller
{ {
public function index() public function index()
{ {
$tours = Tour::query() $tours = Tour::query()
->where('status', 1) ->where('status', 1)
->orderByDesc('created_at') ->orderByDesc('created_at')
@@ -19,9 +20,13 @@ class IndexController extends Controller
->orderByDesc('created_at') ->orderByDesc('created_at')
->paginate(6, ['*'], 'flights_page'); ->paginate(6, ['*'], 'flights_page');
$latestTours= Tour::latest()->limit(6)->get();
$latestFlights = Flight::latest()->limit(6)->get();
return view('index', [ return view('index', [
'tours' => $tours, 'tours' => $tours,
'flights' => $flights, 'flights' => $flights,
compact('latestTours', 'latestFlights')
]); ]);
} }
} }