Migration Fix

This commit is contained in:
2026-04-01 16:41:18 +10:00
parent dd69f1e623
commit e4e5afafa7
+22 -6
View File
@@ -24,9 +24,17 @@ class LogoController extends Controller
public function getLogoByIATACode(string $code) public function getLogoByIATACode(string $code)
{ {
$airline = Airline::where('IATA_code', strtoupper($code)) $airline = Airline::where('IATA_code', strtoupper($code))
->whereNotNull('logo') ->whereNotNull('logo')
->latest('id') ->where('active', true)
->first(); ->latest('id')
->first();
if (!$airline) {
$airline = Airline::where('IATA_code', strtoupper($code))
->whereNotNull('logo')
->latest('id')
->first();
}
return $this->getAirlineLogo($airline); return $this->getAirlineLogo($airline);
} }
@@ -34,9 +42,17 @@ class LogoController extends Controller
public function getLogoByICAOCode(string $code) public function getLogoByICAOCode(string $code)
{ {
$airline = Airline::where('ICAO_code', strtoupper($code)) $airline = Airline::where('ICAO_code', strtoupper($code))
->whereNotNull('logo') ->whereNotNull('logo')
->latest('id') ->where('active', true)
->first(); ->latest('id')
->first();
if (!$airline) {
$airline = Airline::where('ICAO_code', strtoupper($code))
->whereNotNull('logo')
->latest('id')
->first();
}
return $this->getAirlineLogo($airline); return $this->getAirlineLogo($airline);
} }