I am using the Amadeus API to build a flight booking app using backend Laravel. I have fetched the airline code from the API.
foreach ($response['data'] as $flightOffer) {
$airline = $flightOffer['carrierCode'];
$flightList[] = [
'airline' => $airline.
...
];
}
Then, after I pass this data to the frontend using this array. But API does not provide airline logos.
How can I add the airline logo to this array and render it in the frontend? What are the best practices and methods?
Try this
Dynamically fetch airline logos for your flight booking app, you can use various methods. One common approach is to maintain a mapping between airline codes and their respective logos in your application.
Store the airline logos in a directory within your Laravel application (e.g., public/images/airline_logos/).