A Laravel-ready package to integrate Duffel's Flights, Seat Maps, Airlines, Airports, Aircraft, and Cities APIs with clean service-based methods.
composer require misujon/laravel-duffelphp artisan vendor:publish --provider="Misujon\\LaravelDuffel\\LaravelDuffelServiceProvider" --tag="config"In your Laravel app's .env file:
DUFFEL_API_KEY=your_duffel_access_token_here
DUFFEL_API_URL=https://api.duffel.com/
DUFFEL_API_VERSION=v2
DUFFEL_URL_PREFIX="air"In config/app.php under aliases:
'Duffel' => Misujon\LaravelDuffel\Facades\Duffel::class,Description: Search available flights.
Parameters Example:
[
'slices' => [
['origin' => 'DXB', 'destination' => 'LHR', 'departure_date' => '2025-07-15'],
],
'passengers' => [
['type' => 'adult'],
['type' => 'child', 'age' => 8],
],
'cabin_class' => 'economy',
]Usage:
$response = Duffel::searchFlights($searchData);Description: Fetch a specific flight offer.
Usage:
$response = Duffel::getFlightOffer('off_0000AtXxW8gsgU0dRswvHG');Description: Fetch seat maps for a flight offer.
Usage:
$response = Duffel::fetchSeatMaps('off_0000AtXxW8gsgU0dRswvHG');Returns `` if no seat maps found.
Use all the methods by importing the class
Misujon\LaravelDuffel\Facades\DuffelResource;
Fetch list of airlines.
$response = DuffelResource::getAirlines();Fetch a specific airline by ID.
$response = DuffelResource::getSingleAirline('arl_0000A3BCD');Fetch list of aircrafts.
$response = DuffelResource::getAircrafts();Fetch a specific aircraft.
$response = DuffelResource::getSingleAircraft('arc_0000Abc123');Fetch list of airports.
$response = DuffelResource::getAirports();Fetch a specific airport.
$response = DuffelResource::getSingleAirport('apt_0000AbcXYZ');Fetch list of cities.
$response = DuffelResource::getCities();Fetch a specific city.
$response = DuffelResource::getSingleCity('cit_0000Abcd987');Use all the methods by importing the class
Misujon\LaravelDuffel\Facades\OrderService;
Get a list of all created orders.
Duffel::listOrders();Create a new flight order.
Duffel::createOrder([
'selected_offers' => ['off_xxxx'],
'payments' => [[
'type' => 'balance',
'amount' => '100.00',
'currency' => 'USD'
]],
'passengers' => [
['id' => 'pas_xxxx']
]
]);List available services for a given order.
Duffel::listOrderServices('ord_xxxx');Get the details of a specific order.
Duffel::getOrder('ord_xxxx');Update metadata for a specific order.
Duffel::updateOrder('ord_xxxx', [
'metadata' => [
'purpose' => 'client booking'
]
]);Add a service (e.g. bag or seat) to an order.
Duffel::addServiceToOrder('ord_xxxx', [
'services' => [
['id' => 'ase_xxxx']
]
]);use Duffel;
class FlightController extends Controller
{
public function search()
{
$searchData = [...];
return Duffel::searchFlights($searchData);
}
public function airline($id)
{
return Duffel::getSingleAirline($id);
}
public function createOrder()
{
return Duffel::createOrder([...]);
}
}This package is open-sourced software licensed under the MIT license.
Pull requests, issues, and feature suggestions are welcome! Let's build together!
Hi there! π I'm a passionate Full Stack Web Developer with over 5 years of experience crafting powerful, efficient, and creative web solutions. From building robust APIs with PHP/Laravel and Python/Django, to designing dynamic frontend applications with React, Vue, and Next.js, I thrive on solving complex problems and delivering top-quality results.
I specialize in data scraping, API integrations, responsive UI/UX, and full-cycle project management using Agile methodologies. Every project I work on is built with care, innovation, and a strong commitment to excellence. If you enjoy my work, find it useful, or simply want to support an independent developer on their journey β feel free to buy me a coffee!
Your support truly means a lot and helps me keep doing what I love every day. π
Thank you for being awesome! π