Moved to Vue
This commit is contained in:
@@ -21,46 +21,25 @@ class LogoController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function getLogoByIATACode(string $code)
|
||||
{
|
||||
$airline = Airline::where('IATA_code', strtoupper($code))
|
||||
->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);
|
||||
}
|
||||
|
||||
public function getLogoByICAOCode(string $code)
|
||||
{
|
||||
$airline = Airline::where('ICAO_code', strtoupper($code))
|
||||
->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);
|
||||
}
|
||||
|
||||
public function getLogoByCode(string $code){
|
||||
|
||||
return strlen($code) == 2
|
||||
? $this->getLogoByIATACode($code)
|
||||
: $this->getLogoByICAOCode($code);
|
||||
$column = strlen($code) == 2
|
||||
? 'IATA_code'
|
||||
: 'ICAO_code';
|
||||
|
||||
$airline = Airline::where($column, strtoupper($code))
|
||||
->whereNotNull('logo')
|
||||
->where('active', true)
|
||||
->latest('id')
|
||||
->first();
|
||||
|
||||
if (!$airline) {
|
||||
$airline = Airline::where($column, strtoupper($code))
|
||||
->whereNotNull('logo')
|
||||
->latest('id')
|
||||
->first();
|
||||
}
|
||||
|
||||
return $this->getAirlineLogo($airline);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user