fix: update homepage data
This commit is contained in:
@@ -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')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user