feat: complete flightShow and comments flight
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Airport;
|
||||
use App\Models\Flight;
|
||||
use App\Models\Tour;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class IndexController extends Controller
|
||||
@@ -9,6 +12,23 @@ class IndexController extends Controller
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view('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'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user