Skip to main content
Laravel discovers the service provider automatically, so installing the package is the whole setup.

Setup

That is all. The client is now resolvable anywhere:
Or through the container alias:

What comes from your container

Two things, so the SDK fits the application rather than the other way round:
  • The PSR-18 client. Nexus traffic goes through the HTTP stack your application already configures - its proxy settings, middleware and instrumentation apply. If nothing is bound, the SDK discovers whatever implementation the project has. See HTTP client.
  • The PSR-3 logger. SDK diagnostics land in your application log with nothing to configure, the startup summary included: nexus: client ready at info, naming the configs, secrets and flags the first sync delivered - never a value. See Custom logging.

Lazy by design

The binding is deferred and lazy. Creating a client performs a network round-trip, so nothing happens until something actually resolves NexusClient - registering the provider costs nothing, and an application that never reads a config never pays for one.
Once resolved it is a singleton: the snapshot is shared for the rest of the request, or for the life of a worker.

Configuration

The defaults apply whether or not you publish the file. Publish it to change anything beyond the environment variables:

A dedicated log channel

Secret values never appear in that output; key names do, so a line can say which secret it is about - see Custom logging.

Local development

westyx dev run php artisan serve needs no Nexus settings: NEXUS_BASE_URL falls back to WESTYX_SERVICE_ENDPOINT, which the CLI sets, and with no NEXUS_API_KEY and NEXUS_WIF_ENABLED unset the provider uses WIF, which reaches the session westyx dev setup stored. Set NEXUS_WIF_ENABLED=false to turn that default off. Under PHP-FPM the variable is not visible to workers by default (clear_env = yes); see Configuration.

Framework settings stay in .env

APP_ENV, APP_KEY, DB_CONNECTION and the rest of Laravel’s own settings cannot come from Nexus: Laravel reads .env while it bootstraps, before any service provider registers, so a Nexus config of that name changes nothing. Keep them in the environment, and read what your own code decides at runtime from Nexus.

Workload Identity Federation

On EKS, GKE, AKS or any Kubernetes cluster, drop the API key entirely:
The workload’s own identity is exchanged for a short-lived session, refreshed transparently before it expires. See Workload identity.

Live updates in a worker

connectStream() blocks and does not return, so it belongs in a dedicated console command rather than in a request:
Run it under your process supervisor alongside queue:work. See SSE live updates.

Supported versions

Laravel 11, 12 and 13. Laravel 11 is past its own support window (its security fixes ended on 2026-03-12) and stays supported by the SDK; the lowest supported versions are tested in CI. The package installs cleanly in a non-Laravel project too - the provider class is only loaded by Laravel’s own discovery.