Save user flights

This commit is contained in:
2026-04-05 18:52:24 +10:00
parent d0fe6d78d3
commit 9631e7949d
4 changed files with 8 additions and 5 deletions
@@ -83,7 +83,7 @@ class FlightImportController extends Controller
->get(['id', 'name', 'municipality', 'iata_code', 'icao_code', 'region_id'])
->map(fn($a) => [
'value' => $a->id,
'title' => "{$a->name} ({$a->iata_code}/{$a->icao_code})",
'title' => "{$a->municipality} / {$a->name} ({$a->iata_code}/{$a->icao_code})",
'country_code' => strtolower($a?->region->country->code ?? ''),
])
->values()
@@ -129,7 +129,7 @@ class FlightImportController extends Controller
{
$user = Auth::user();
$flightToReconcile = ImportedFlight::where('user_id', $user->id)->orderBy('id')->first();
$flightToReconcile = ImportedFlight::where('user_id', $user->id)->orderBy('date', 'asc')->first();
if (!$flightToReconcile) {
return null;
+1 -1
View File
@@ -66,7 +66,7 @@ class SearchController extends Controller
->get(['id', 'name', 'municipality', 'iata_code', 'icao_code', 'region_id'])
->map(fn($a) => [
'value' => $a->id,
'title' => "{$a->name} ({$a->iata_code}/{$a->icao_code})",
'title' => "{$a->municipality} / {$a->name} ({$a->iata_code}/{$a->icao_code})",
'country_code' => strtolower($a->region->country->code),
])
->values();
+1 -2
View File
@@ -14,8 +14,7 @@ class Airline extends Model
'ICAO_code',
'name',
'internal_name',
'country_code',
'country_name',
'country_id',
'active',
'logo',
];