feat(flights): add flight listing with dynamic data in index

This commit is contained in:
2026-08-17 15:51:25 +03:30
parent 08188f1026
commit 68157e043c
3 changed files with 102 additions and 147 deletions
+9 -2
View File
@@ -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'));
}
}