Download the PHP package flairuk/laravel-uber without Composer
On this page you can find all versions of the php package flairuk/laravel-uber. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download flairuk/laravel-uber
More information about flairuk/laravel-uber
Files in flairuk/laravel-uber
Download flairuk/laravel-uber
More information about flairuk/laravel-uber
Files in flairuk/laravel-uber
Vendor flairuk
Package laravel-uber
Short Description A Laravel client for the Uber APIs: rides, guest rides, Uber Direct deliveries, Uber Eats Marketplace and Uber for Business, with OAuth, cached app tokens and verified webhooks.
License MIT
Homepage https://github.com/FLAIRUK/laravel-uber
Package laravel-uber
Short Description A Laravel client for the Uber APIs: rides, guest rides, Uber Direct deliveries, Uber Eats Marketplace and Uber for Business, with OAuth, cached app tokens and verified webhooks.
License MIT
Homepage https://github.com/FLAIRUK/laravel-uber
Please rate this library. Is it a good library?
Informations about the package laravel-uber
**Laravel Uber** โ A Laravel 12 and 13 client for the [Uber developer platform](https://developer.uber.com/docs): rides, guest and health rides, Uber Direct deliveries, the Uber Eats Marketplace, Uber for Business, Login with Uber, drivers, vehicle suppliers, Ads, AI Solutions and Uber Pay, behind one facade.
- **Every documented API.** 12 APIs and about 250 endpoints, mapped from Uber's published OpenAPI specs and reference pages. Each one has a test that checks its method, path and scope.
- **Tokens handled.** App tokens are fetched per scope with the client-credentials grant, cached until shortly before they expire, and replaced if Uber rejects them. User tokens from the OAuth flow (with PKCE or pushed authorization requests) are passed with `withToken()`.
- **The right host.** Production is `api.uber.com`. Each API's sandbox is chosen for you: `sandbox-api` for rides, `test-api` with `sandbox-login` tokens for Eats.
- **Verified webhooks.** One route verifies Uber's HMAC signatures, whichever key the API signs with. It de-duplicates retries and dispatches Laravel events.
- **Safe retries.** Reads are retried on connection errors and 5xx responses. Ride requests, deliveries, orders, charges and cancellations never are.
- **Real errors.** Uber's error shapes are turned into typed exceptions that carry the error code, metadata and the surge-confirmation link.
> This is an unofficial package. It is not affiliated with or endorsed by Uber. Most Uber APIs need approval from Uber for your app and its scopes.
๐ฆ Installation ยท ๐ Authentication ยท ๐ Rides ยท ๐ฆ Direct ยท ๐ Eats ยท ๐ผ Business ยท ๐งฉ More ยท ๐ Webhooks ยท โ ๏ธ Errors ยท โ๏ธ Configuration
## ๐ฆ Installation `uber:install` publishes `config/uber.php` and adds these keys to `.env` and `.env.example`: Then check that Uber issues a token for a scope your app is approved for:
## ๐ Authentication You can also type-hint `FLAIRUK\Uber\Uber` to have it injected. **App endpoints** need no setup. These include Direct, Eats, Guest Rides, Health, Business, Vehicle Suppliers and AI Solutions. The package asks `auth.uber.com` for a client-credentials token with the scope each endpoint needs, and caches it. Uber allows only 100 token requests an hour, and each new token past that invalidates the oldest, so the cache matters. **User endpoints** act for a person: a rider, a driver, a store owner activating your Eats integration, or an Ads user. Send them through Uber's OAuth flow, then pass their token: More OAuth:
## ๐ Rides ### Riders API (acting for a rider) Ride requests need the privileged `request` scope. If the product is surging, `request()` throws a `ConflictException` whose `surgeConfirmationUrl()` you send the rider to. Then request again with the `surge_confirmation_id`. Uber's current reference page documents only products, estimates, me, payment methods and creating a request. The other endpoints (current trip, history, places, map and receipt) still work for existing integrations but no longer have reference pages. In the sandbox, step a trip through its states yourself: ### Guest Rides and Uber Health These order rides for people who don't need an Uber account, billed to your organisation. Guest Rides uses scope `guests.trips` and Health uses scope `health`; both share the same API shape. Third-party apps acting for another organisation call `forOrganization($orgId)` or set `UBER_ORGANIZATION_ID`. Either way, the package sends the `x-uber-organizationuuid` header. In the sandbox, create a run with test drivers and drive the trip through its states:
## ๐ฆ Uber Direct Courier delivery from your store to your customer. It uses scope `eats.deliveries` and `UBER_DIRECT_CUSTOMER_ID`. Merchant and store management uses scope `direct.organizations`: Uber Direct Japan uses the same API, so this client covers it too.
## ๐ Uber Eats For point-of-sale and order-management systems. **Activating a store.** The merchant authorizes your app with `eats.pos_provisioning`. Then, with their token: Uber then sends `store.provisioned`, and from then on app tokens work for that store.
## ๐ผ Uber for Business Identity administration (org units, users and role assignments):
## ๐งฉ More APIs ### Anything else For endpoints without a wrapper, call them directly. The package still handles authentication, error mapping and retries: **Not wrapped:** - Third-party Demand Rides and the `/docs/secured` APIs: partner-only, with no documented scopes. - Uber Freight: it has a separate portal. - SCIM: it needs a token issued through your identity provider. - Consumer Delivery: no endpoints are published.
## ๐ Webhooks The package registers `POST /uber/webhook`, which has no CSRF check. Point every Uber dashboard at it, then listen: - **Signatures.** Every request must carry a valid `X-Uber-Signature`; Direct also sends `X-Postmates-Signature`, which is accepted too. Riders, Eats and Vehicle Suppliers sign with your client secret. Guest Rides, Health, Business and Direct sign with each webhook's signing key, so add those keys to `UBER_WEBHOOK_SIGNING_KEY`. - **Retries and order.** Uber retries failed deliveries and doesn't guarantee order. Events are de-duplicated by id for 48 hours. If a listener throws, the event is forgotten, so Uber's retry is processed. Fetch `$event->resourceHref` for the current state rather than trusting arrival order. - **Your own route.** Set `UBER_WEBHOOK_PATH=` (empty) and use the `uber.webhook` middleware on a route of your own.
## โ ๏ธ Errors A `ConfigurationException` (also an `UberException`) means a credential or id is missing. It is thrown before anything is sent.
## โ๏ธ Configuration | Key | Env | Default | | --- | --- | --- | | `client_id`, `client_secret` | `UBER_CLIENT_ID`, `UBER_CLIENT_SECRET` | | | `sandbox` | `UBER_SANDBOX` | `false` | | `base_url` | `UBER_BASE_URL` | chosen per API | | `locale` | `UBER_LOCALE` | Uber's default (sent as `Accept-Language`) | | `oauth.url` | `UBER_OAUTH_URL` | `https://auth.uber.com` | | `oauth.redirect_uri` | `UBER_REDIRECT_URI` | | | `oauth.scopes` | `UBER_SCOPES` | `profile` | | `direct.customer_id` | `UBER_DIRECT_CUSTOMER_ID` | | | `business.organization_id` | `UBER_ORGANIZATION_ID` | | | `business.vouchers_scope` | `UBER_VOUCHERS_SCOPE` | `organizations.voucher_programs` | | `health.scope` | `UBER_HEALTH_SCOPE` | `health` | | `ads.account_id` | `UBER_ADS_ACCOUNT_ID` | | | `webhooks.path` | `UBER_WEBHOOK_PATH` | `uber/webhook` | | `webhooks.signing_keys` | `UBER_WEBHOOK_SIGNING_KEY` | | | `timeout` | `UBER_TIMEOUT` | `30` seconds | | `retry` | | 2 retries, 500 ms apart (reads only) | | `cache_store` | `UBER_CACHE_STORE` | the default store | Scope one call differently without changing the defaults:
## ๐งช Testing The client uses Laravel's HTTP client, so `Http::fake()` works in your own tests. Fake the token endpoint too:
## ๐ License The MIT License (MIT). See [LICENSE](LICENSE) for details. Uber is a trademark of Uber Technologies, Inc. This package is not affiliated with or endorsed by Uber.
All versions of laravel-uber 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/events Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/routing 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/events Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/routing Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
The package flairuk/laravel-uber contains the following files
Loading the files please wait ...