Download the PHP package flairuk/laravel-all-aboard without Composer

On this page you can find all versions of the php package flairuk/laravel-all-aboard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-all-aboard

PHP 8.2+  Laravel 12 or 13  Lint  Tests  Downloads on Packagist  MIT licence  All Aboard GraphQL API 
 

**Laravel All Aboard** โ€” A Laravel 12 and 13 client for the [All Aboard API](https://allaboard.eu/api-solution), for travel sites and agents that search, price and book European train journeys and rail passes. - **The whole booking flow.** Covers locations, journey search, offers (including round-trip fares), bookings, orders, payment-gateway checkout, tickets, rail passes, travel cards, refunds and access tokens. - **No GraphQL to write.** Every method sends a query with a sensible set of fields, checked against the live schema. Pass your own fields when you need more or less. - **Pagination built in.** Locations and orders can be walked with `->lazy()`, which fetches the next page only when you reach it. - **Safe retries.** Queries are retried on connection errors and 5xx responses. Bookings, orders, payments and refunds never are, so nothing is booked or charged twice. - **Real errors.** GraphQL errors throw exceptions carrying All Aboard's error codes (`NO_TICKETS`, `PRICE_CHANGED`โ€ฆ), their arguments and the request id to quote to their support. > This is an unofficial package. It is not affiliated with or endorsed by All Aboard. You need your own All Aboard account and API key.

๐Ÿ“ฆ Installation ยท ๐Ÿš€ Usage ยท ๐Ÿš† Booking flow ยท ๐ŸŽซ Rail passes ยท โš ๏ธ Errors ยท โš™๏ธ Configuration



## ๐Ÿ“ฆ Installation `all-aboard:install` publishes `config/all-aboard.php` and adds these keys to `.env` and `.env.example`: Then check the connection: The test environment is a separate gateway and needs a key with the `test` scope. Keys are given scopes in the [Dashboard](https://allaboard.eu/agent): `live` or `test` for access at all, `orders:read` to read orders, and `payments:wallet`, `payments:stripe` or `payments:invoice` for each way of paying. See [API Scopes](https://docs.allaboard.eu/intro/scopes).

## ๐Ÿš€ Usage You can also type-hint `FLAIRUK\AllAboard\AllAboard` to have it injected. Every call returns a `Response` wrapping the operation's result: Prices are `['amount' => 13400, 'currency' => 'EUR']`, with the amount in minor units (cents, pence). ### Locations Journeys are searched between location `uid`s. All Aboard recommends keeping your own copy of the locations and re-syncing it on a schedule: Remove any you stored that the walk no longer returns. For autocomplete, you can also ask the API directly: A **meta** location (`isMeta: true`) is a city rather than one station: "Paris" rather than "Paris Gare de Lyon". Searching from it lets the API pick the right station for the route, so prefer meta locations and list them first. ### Finding journeys Search the whole trip and let the API route it: Options follow the [`journeys`](https://docs.allaboard.eu/tickets/) query: ### Getting offers An offer is a way to travel a journey: a price, a flexibility and a class. Pricing waits on the train operators and can take up to 30 seconds: Passengers can be arrays, or shorthand: `'adult'` for a type, `30` for an age. Up to five per request. All Aboard has no hard look-to-book limit, but asks that you only price journeys a customer is likely to book. **Round trips** are priced in one call, so operators can quote genuine return fares: Offers that share a `memberOf.id` are one ticket (a return fare shows as a full price one way and a zero-priced companion the other). Book all of them together or none. ### Travel cards Railcards, discount cards and passes such as Interrail change what a passenger pays: Send exactly the same passengers and cards when you create the booking. Cards can't be changed afterwards. ### Anything else For operations or fields without a wrapper, run GraphQL directly. Authentication, the session header and error handling still apply: Every resource method takes a `fields` argument to replace its default selection. The defaults are constants on `FLAIRUK\AllAboard\Fields` if you want to build on them:

## ๐Ÿš† Booking flow Create a booking from the offers, add the passengers' details, create an order to pre-book the tickets, then pay: Then, depending on how your cost center pays: `create()`, `finalize()` and `createPayment()` are never retried automatically. If one of them times out, check with `orders()->find()` before trying again. ### Changing the booking To bill passengers to a [cost center](https://docs.allaboard.eu/payments/cost-centers) other than your default, set it on them when creating the booking: ### Tickets Tickets are issued after finalizing, usually within 15 minutes. Poll the order, for example from a queued job: `tickets()` is empty until issuance completes. List orders with `AllAboard::orders()->list()->lazy()` (needs `orders:read`). ### Refunds ### Public pages and access tokens Never put an API key with `orders:read` on a page the public can open. Mint an access token for the one order instead. It reaches nothing else and expires on its own: Pass it to the [Refund Manager embed](https://docs.allaboard.eu/embeds/aa-refund-manager-modal), or use it from PHP:

## ๐ŸŽซ Rail passes All Aboard finds the cheapest combination of passes (a **bundle**) covering every passenger: Booking a pass follows the same flow as tickets: Each passenger's pass code appears in `orders()->tickets()` once issued.

## โš ๏ธ Errors and rate limits All Aboard reports errors in the GraphQL response, each with a code: The full list is in [Error Codes](https://docs.allaboard.eu/ref/errors). In queued jobs, release the job on a rate limit: `AllAboard::agent()->rateLimits()` shows each of your limits, how much is left and when it resets.

## โš™๏ธ Configuration | Key | Env | Default | | --- | --- | --- | | `api_key` | `ALL_ABOARD_API_KEY` | | | `test` | `ALL_ABOARD_TEST` | `false` | | `base_url` | `ALL_ABOARD_BASE_URL` | built from `test` | | `session` | `ALL_ABOARD_SESSION` | from the Laravel session | | `currency` | `ALL_ABOARD_CURRENCY` | EUR, All Aboard's default | | `timeout` | `ALL_ABOARD_TIMEOUT` | `90` seconds | | `retry` | | 2 retries, 500 ms apart (queries only) | | `cache.store` | `ALL_ABOARD_CACHE_STORE` | the default cache store | | `cache.ttl` | | 24 hours; `null` turns caching off | Every request carries a `session` header, which All Aboard uses to trace one customer's booking flow. By default it is a hash of the Laravel session id, so a customer's requests share one; outside a web request (in a queued job, say) each client gets a random one. Set it yourself to tie a job back to the customer: Scope a single call differently without changing the defaults: ### Streaming All Aboard can stream journey offers over WebSockets as each part is priced. This package uses plain HTTP, which waits for the complete result. If you want prices to appear as they arrive, use the [embeds](https://docs.allaboard.eu/embeds/) or a [graphql-ws](https://the-guild.dev/graphql/ws) client in the browser.

## ๐Ÿงช 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. All Aboard is a trademark of its owner. This package is not affiliated with or endorsed by All Aboard.

All versions of laravel-all-aboard 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
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package flairuk/laravel-all-aboard contains the following files

Loading the files please wait ...