andrewdavid / duffel-api-php
Duffel API library for PHP (with missing features)
dev-main
2023-06-24 18:08 UTC
Requires
- php: >= 7.4
- ext-json: *
- php-http/client-common: ^2.3
- php-http/discovery: ^1.12
- php-http/httplug: ^2.2
- php-http/multipart-stream-builder: ^1.1.2
- psr/cache: ^1.0 || ^2.0
- psr/http-client-implementation: ^1.0
- psr/http-factory-implementation: ^1.0
- psr/http-message: ^1.0
- symfony/options-resolver: ^5.0 || ^6.0
Requires (Dev)
- ergebnis/phpstan-rules: ^1.0
- guzzlehttp/guzzle: ^7.2
- guzzlehttp/psr7: ^1.7
- http-interop/http-factory-guzzle: ^1.0
- php-http/mock-client: ^1.4.1
- phpstan/phpstan: ^1.6
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-strict-rules: ^1.2
- phpunit/phpunit: ^8.5 || ^9.4
- thecodingmachine/phpstan-strict-rules: ^1.0
- vimeo/psalm: ^4.23
This package is auto-updated.
Last update: 2024-12-24 21:38:15 UTC
README
A PHP library for the Duffel API.
Contents
Requirements
- PHP >= 7.4
- A Duffel API access token (this quick start guide will help you to create one)
Installation
To get started, simply require this library using
Composer. You will also need to install packages
which provide
psr/http-client-implementation
and
psr/http-factory-implementation
.
An installation could look like the following command.
$ composer require "duffel/api:dev-main" "guzzlehttp/guzzle:^7.4" "http-interop/http-factory-guzzle:^1.2
Usage
A simple example of using this library (after successfully installing it) follows.
use Duffel\Client; $client = new Duffel\Client(); $client->setAccessToken(getenv('DUFFEL_ACCESS_TOKEN')); $client->airports->list();
See the examples/
directory for additional working examples.
License
Duffel's PHP API Client library is licensed under the MIT license.