35 lines
650 B
PHP
35 lines
650 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Airport;
|
|
use App\Models\Flight;
|
|
use App\Models\Tour;
|
|
use Illuminate\Http\Request;
|
|
|
|
class IndexController extends Controller
|
|
{
|
|
|
|
public function index()
|
|
{
|
|
$flights = Flight::query()
|
|
->with([
|
|
'airport.city',
|
|
'airline',
|
|
'file'
|
|
])
|
|
->orderByDesc('created_at')
|
|
->limit(10)
|
|
->paginate();
|
|
|
|
$tours = Tour::query()
|
|
->orderByDesc('created_at')
|
|
->limit(10)
|
|
->paginate();
|
|
|
|
|
|
|
|
return view('index', compact('tours','flights'));
|
|
}
|
|
}
|