feat(flights): add flight listing with dynamic data in index
This commit is contained in:
@@ -16,7 +16,14 @@ class IndexController extends Controller
|
||||
->orderByDesc('created_at')
|
||||
->limit(4)
|
||||
->get();
|
||||
|
||||
return view('index' , compact('tours'));
|
||||
$flights = Flight::query()
|
||||
->with(['airline', 'airport', 'destinationAirport'])
|
||||
->orderByDesc('created_at')
|
||||
->limit(4)
|
||||
->get();
|
||||
$flights->each(function ($flight) {
|
||||
$flight->start_date_fa = verta($flight->start_time)->format('%d %B');
|
||||
});
|
||||
return view('index' , compact('tours' , 'flights'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user