Files
hatame.andarza09/app/Http/Controllers/HomeController.php
T
hatame 970786ae94 git add .
git commit  "add tours pages, components and show views"
2026-08-17 11:36:19 +03:30

36 lines
720 B
PHP

<?php
namespace App\Http\Controllers;
use App\Models\Flight;
use App\Models\Tour;
use App\Models\Province;
class HomeController extends Controller
{
public function index()
{
$newestFlight = Flight::
where('departure_date', '>=', now())
->orderBy('departure_date', 'asc')
->take(3)
->get();
$newestTour = Tour::latest()
->take(10)
->get();
$flights = Flight::latest()
->paginate(5);
$tours = Tour::latest()
->paginate(5);
return view('home.index', compact(
'newestFlight',
'newestTour',
'flights',
'tours'
));
}
}