36 lines
721 B
PHP
36 lines
721 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Flight;
|
|
use App\Models\Tour;
|
|
use Illuminate\Http\Request;
|
|
|
|
class IndexController extends Controller
|
|
{
|
|
|
|
public function index()
|
|
{
|
|
$title = 'صفحه اصلی';
|
|
|
|
$flights = Flight::query()
|
|
->with([
|
|
'departureAirport.city',
|
|
'arrivalAirport.city',
|
|
'airline',
|
|
'file',
|
|
])
|
|
->orderByDesc('created_at')
|
|
->limit(10)
|
|
->paginate();
|
|
|
|
$tours = Tour::query()
|
|
->orderByDesc('created_at')
|
|
->take(10)
|
|
->paginate();
|
|
|
|
return view('index', compact('flights', 'tours','title'));
|
|
}
|
|
}
|
|
|