docs: list unirate_api in config/swap.php + provider tables - #99
Conversation
Exchanger merged UniRateAPI support in florianv/exchanger#180 and Swap's docs PR is florianv/swap#155. Laravel Swap auto-inherits the underlying Swap service list, so `'unirate_api' => ['api_key' => env(...)]` already works on master once the next Exchanger release tag lands; only the docs and the published config stub were missing. - config/swap.php: add `unirate_api` to the in-file docblock spec list (after `xchangeapi`) and add a commented-out example line to the `services` array next to the other commercial providers, mirroring the existing `apilayer_fixer` / `open_exchange_rates` examples. - README.md: add `UniRateAPI` row to the commercial provider table (alphabetical, between `open_exchange_rates` and `webservicex`); bump count 30 → 31. - doc/readme.md: add `unirate_api` / `api_key` row to the commercial configuration table. UniRateAPI is a commercial REST API for FX. Latest rates are on the free tier; historical and commodities are paid-tier only — the upstream `Exchanger\Service\UniRateApi` maps HTTP 403 on those endpoints to `Exchanger\Exception\ChainException`, matching the existing fastFOREX / Fixer plan-gated behaviour.
There was a problem hiding this comment.
Pull request overview
Updates Laravel Swap’s published config stub and documentation tables to mention the newly added upstream unirate_api provider identifier, so Laravel users can discover/configure UniRateAPI via the standard config/swap.php publish flow.
Changes:
- Add
unirate_apito the commercial providers list inREADME.mdand update the stated provider count. - Add
unirate_apito the commercial provider configuration table indoc/readme.md. - Add a UniRateAPI config-spec example and a commented
servicesentry toconfig/swap.php.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| README.md | Adds UniRateAPI to the commercial providers table and bumps the stated provider count. |
| doc/readme.md | Documents unirate_api required option (api_key) in the provider configuration table. |
| config/swap.php | Adds UniRateAPI to the in-file config spec and provides a commented example services entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ## 📊 Providers | ||
|
|
||
| Laravel Swap supports the 30 exchange rate providers from the underlying [Swap](https://github.com/florianv/swap) library. Pass the **identifier** as the key under `services` in `config/swap.php`. | ||
| Laravel Swap supports the 31 exchange rate providers from the underlying [Swap](https://github.com/florianv/swap) library. Pass the **identifier** as the key under `services` in `config/swap.php`. |
| | ] | ||
| | | ||
| | * 'unirate_api' => [ | ||
| | 'api_key' => 'secret', // The API token. Get a free one at https://unirateapi.com |
|
Quick note picking up the Copilot suggestions: Provider count (README, line 107): Same situation as the parallel swap PR (florianv/swap#155) — Exchanger PR #180 merged 2026-05-18 but the last Exchanger release tag (2.9.1) was 2026-05-14, so packagist installs don't ship
Docblock wording ( No other pending changes on my end. (UniRateAPI affiliation disclosed in the PR body.) |
Adds UniRateAPI to the Laravel-Swap config stub and the documented provider lists, following the merged work upstream:
UniRateApiservice and registered it under the identifierunirate_api.SwapServiceProviderbuilds the chain by iterating theservicesarray inconfig/swap.phpand forwarding each entry toSwap\Builder::add($identifier, $options), which delegates toExchanger\Service\Registry. Once the next Exchanger release tag publishes, Laravel-Swap users can drop in:…with no further wiring. This PR only updates the published config and the docs.
Changes
unirate_apito the in-file docblock spec list (afterxchangeapi), matching the existingfastforex/apilayer_fixer/forgeblocks.'unirate_api' => ['api_key' => env('SWAP_UNIRATE_API_KEY')]line next to the other commercial-provider examples inservices.UniRateAPIrow to the commercial provider table (alphabetical, betweenopen_exchange_ratesandwebservicex); bumps the count30 → 31.unirate_api/api_keyrow to the commercial configuration table.Notes
unirate_apimatches the key inExchanger\Service\Registry::getServices()after #180; Laravel-Swap doesn't need any code change to pick it up./api/historical) and commodities are paid-tier only — the upstreamUniRateApi.phpmaps HTTP 403 on those endpoints toExchanger\Exception\ChainException, matching the existing fastFOREX / Fixer plan-gated behaviour, so the chain falls through cleanly.Disclosure
I work with UniRateAPI. The implementation work (Exchanger #180) was done first; opening this docs + config-stub PR now that the upstream merge has landed so Laravel users discover the provider through the standard publish flow instead of having to read the changelog. Happy to revise the wording, drop the count bump until the next Exchanger release tag, or split the README/doc changes off from
config/swap.phpif you'd rather review them separately.