From e4e5afafa725f5ca66f51ca20ef44df6410a8533 Mon Sep 17 00:00:00 2001 From: josh Date: Wed, 1 Apr 2026 16:41:18 +1000 Subject: [PATCH] Migration Fix --- app/Http/Controllers/LogoController.php | 28 +++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/LogoController.php b/app/Http/Controllers/LogoController.php index d15e226..6841205 100644 --- a/app/Http/Controllers/LogoController.php +++ b/app/Http/Controllers/LogoController.php @@ -24,9 +24,17 @@ class LogoController extends Controller public function getLogoByIATACode(string $code) { $airline = Airline::where('IATA_code', strtoupper($code)) - ->whereNotNull('logo') - ->latest('id') - ->first(); + ->whereNotNull('logo') + ->where('active', true) + ->latest('id') + ->first(); + + if (!$airline) { + $airline = Airline::where('IATA_code', strtoupper($code)) + ->whereNotNull('logo') + ->latest('id') + ->first(); + } return $this->getAirlineLogo($airline); } @@ -34,9 +42,17 @@ class LogoController extends Controller public function getLogoByICAOCode(string $code) { $airline = Airline::where('ICAO_code', strtoupper($code)) - ->whereNotNull('logo') - ->latest('id') - ->first(); + ->whereNotNull('logo') + ->where('active', true) + ->latest('id') + ->first(); + + if (!$airline) { + $airline = Airline::where('ICAO_code', strtoupper($code)) + ->whereNotNull('logo') + ->latest('id') + ->first(); + } return $this->getAirlineLogo($airline); }