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
@@ -27,9 +27,9 @@ class SearchController extends Controller
})
->limit(50)
->get(['id', 'name', 'IATA_code', 'ICAO_code', 'logo'])
->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();
}
@@ -45,9 +45,9 @@ class SearchController extends Controller
->limit(200)
->orderBy('id', 'asc')
->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();
}
@@ -74,10 +74,10 @@ class SearchController extends Controller
", [$q, $q]))
->limit(15)
->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();
}