Updated logo API
This commit is contained in:
@@ -39,12 +39,6 @@ class LogoController extends ApiController
|
||||
]);
|
||||
}
|
||||
|
||||
public function getLogoById($id){
|
||||
$airline = Airline::where('id', $id)
|
||||
->first();
|
||||
|
||||
return $this->getAirlineLogo($airline);
|
||||
}
|
||||
|
||||
public function getLogoByInternalName(string $internalName){
|
||||
$airline = Airline::where('internal_name', $internalName)
|
||||
@@ -53,26 +47,4 @@ class LogoController extends ApiController
|
||||
return $this->getAirlineLogo($airline);
|
||||
}
|
||||
|
||||
|
||||
public function getLogoByCode(string $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