Download the PHP package flairuk/laravel-booking-com without Composer
On this page you can find all versions of the php package flairuk/laravel-booking-com. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download flairuk/laravel-booking-com
More information about flairuk/laravel-booking-com
Files in flairuk/laravel-booking-com
Download flairuk/laravel-booking-com
More information about flairuk/laravel-booking-com
Files in flairuk/laravel-booking-com
Vendor flairuk
Package laravel-booking-com
Short Description A Laravel client for the Booking.com Demand API: search, availability, property content, orders and car rentals.
License MIT
Homepage https://github.com/FLAIRUK/laravel-booking-com
Package laravel-booking-com
Short Description A Laravel client for the Booking.com Demand API: search, availability, property content, orders and car rentals.
License MIT
Homepage https://github.com/FLAIRUK/laravel-booking-com
Please rate this library. Is it a good library?
Informations about the package laravel-booking-com
**Laravel Booking.com** — A Laravel 12 and 13 client for the [Booking.com Demand API](https://developers.booking.com/demand/docs), for affiliates and travel sites that search, show and book Booking.com stays and car rentals.
- **Every stable endpoint.** Covers accommodation search, availability, content, reviews and changes; locations; orders (preview, create, modify, cancel); car rentals; and messaging.
- **Pagination built in.** Any paginated result can be walked with `->lazy()`, which fetches the next page only when you reach it.
- **Rate-limit friendly.** Reference data is cached. A `429` raises a `RateLimitException` that tells you how long to wait.
- **Safe retries.** Reads are retried on connection errors and 5xx responses. Order creation, changes and cancellations never are, so nothing is booked or cancelled twice.
- **Real errors.** Failures throw exceptions carrying Booking.com's error ids and the `request_id` to quote to their support.
> This is an unofficial package. It is not affiliated with or endorsed by Booking.com. You need your own Booking.com affiliate partner account and API key.
📦 Installation · 🚀 Usage · 🛏️ Booking flow · ⚠️ Errors · ⚙️ Configuration
## 📦 Installation `booking-com:install` publishes `config/booking-com.php` and adds these keys to `.env` and `.env.example`: Then check the connection: The sandbox uses your normal credentials, with test properties such as `10507360` (Demand API Sandbox Hotel Orion, Amsterdam). Car rentals aren't available in the sandbox.
## 🚀 Usage You can also type-hint `FLAIRUK\BookingCom\BookingCom` to have it injected. Request bodies are plain arrays in the shape the [API reference](https://developers.booking.com/demand/docs/open-api/3.2/demand-api) documents. Dates can be given as `DateTimeInterface` objects. Every call returns a `Response`: ### Searching for stays `booker` and `currency` fall back to `BOOKING_COM_BOOKER_COUNTRY`, `BOOKING_COM_BOOKER_PLATFORM` and `BOOKING_COM_CURRENCY`. The booker's country decides the prices and how taxes are shown, so pass each visitor's real country when you know it. You can also search by `country`, `region`, `district`, `landmark`, `airport`, `coordinates` (latitude, longitude and radius) or a list of `accommodations`. ### Availability, content and reviews ### Keeping stored content up to date Store property content and refresh only what changed: ### Locations Accommodation searches use Booking.com's own location ids: ### Car rentals ### Anything else For endpoints without a wrapper, such as Beta endpoints, call them directly. Authentication and error handling still apply:
## 🛏️ Booking flow Preview the order to get the final price, policies and an `order_token`. Then create the order with that token: After booking: `create()`, `modify()` and `cancel()` are never retried automatically. If one of them times out, check with `orders()->find()` before trying again. > **Card data:** if your integration takes card payments, card details pass straight through to Booking.com in the `create()` payload. Make sure your own logging, error reporting and queues never record that payload, and check your PCI DSS obligations. ### Messaging Guest–property messaging is available in API version 3.1, and in 3.2 for partners with Beta access:
## ⚠️ Errors and rate limits In queued jobs, release the job on a rate limit: Your account's rate limit is set by Booking.com; your Account Manager can tell you what it is.
## ⚙️ Configuration | Key | Env | Default | | --- | --- | --- | | `token` | `BOOKING_COM_TOKEN` | | | `affiliate_id` | `BOOKING_COM_AFFILIATE_ID` | | | `sandbox` | `BOOKING_COM_SANDBOX` | `false` | | `version` | `BOOKING_COM_API_VERSION` | `3.2` | | `base_url` | `BOOKING_COM_BASE_URL` | built from `sandbox` and `version` | | `defaults.booker.country` | `BOOKING_COM_BOOKER_COUNTRY` | | | `defaults.booker.platform` | `BOOKING_COM_BOOKER_PLATFORM` | `desktop` | | `defaults.currency` | `BOOKING_COM_CURRENCY` | | | `timeout` | `BOOKING_COM_TIMEOUT` | `30` seconds | | `retry` | | 2 retries, 500 ms apart (reads only) | | `cache.store` | `BOOKING_COM_CACHE_STORE` | the default cache store | | `cache.ttl` | | 24 hours; `null` turns caching off | Scope a single call differently without changing the defaults:
## 🧪 Testing The client uses Laravel's HTTP client, so `Http::fake()` works in your own tests:
## 📄 License The MIT License (MIT). See [LICENSE](LICENSE) for details. Booking.com is a trademark of Booking.com B.V. This package is not affiliated with or endorsed by Booking.com.
All versions of laravel-booking-com with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.2
illuminate/cache Version ^12.0|^13.0
illuminate/collections Version ^12.0|^13.0
illuminate/console Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
illuminate/cache Version ^12.0|^13.0
illuminate/collections Version ^12.0|^13.0
illuminate/console Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
The package flairuk/laravel-booking-com contains the following files
Loading the files please wait ...