Add more airlines and fix edit bugs

This commit is contained in:
2026-04-18 14:22:51 +10:00
parent 147bf43f09
commit 63d6fb9e76
8 changed files with 106 additions and 30 deletions
+10 -10
View File
@@ -55,9 +55,9 @@ class FlightImportController extends Controller
->orderBy('model_full_name')
->limit(10)
->get(['id', 'manufacturer_code', 'model_full_name', 'designator'])
->map(fn($a) => [
'value' => $a->id,
'title' => "{$a->manufacturer_code} {$a->model_full_name} ({$a->designator})",
->map(fn($aircraft) => [
'value' => $aircraft->id,
'title' => $aircraft->displayName(),
])
->values()
->toArray();
@@ -92,10 +92,10 @@ class FlightImportController extends Controller
->limit(10)
->orderBy('id')
->get(['id', 'name', 'municipality', 'iata_code', 'icao_code', 'region_id'])
->map(fn($a) => [
'value' => $a->id,
'title' => "{$a->municipality} / {$a->name} ({$a->iata_code}/{$a->icao_code})",
'country_code' => strtolower($a?->region->country->code ?? ''),
->map(fn($airport) => [
'value' => $airport->id,
'title' => $airport->displayName(),
'country_code' => strtolower($airport?->region->country->code ?? ''),
])
->values()
->toArray();
@@ -129,9 +129,9 @@ class FlightImportController extends Controller
->orderByDesc('active')
->limit(10)
->get(['id', 'name', 'IATA_code', 'ICAO_code'])
->map(fn($a) => [
'value' => $a->id,
'title' => "{$a->name} ({$a->IATA_code}/{$a->ICAO_code})",
->map(fn($airline) => [
'value' => $airline->id,
'title' => $airline->displayName(),
])
->values()
->toArray();