git add .
git commit "Add latest flights and tours components"
This commit is contained in:
@@ -3,16 +3,20 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Flight;
|
||||
use App\Models\Tour;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$latestFlights = Flight::query()
|
||||
->latest()
|
||||
$flights = Flight::latest('created_at')
|
||||
->take(6)
|
||||
->get();
|
||||
|
||||
return view('home.index', compact('latestFlights'));
|
||||
$tours = Tour::latest('created_at')
|
||||
->take(6)
|
||||
->get();
|
||||
|
||||
return view('home.index', compact('flights', 'tours'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user