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. 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 and secret key names never appear in that output - see Custom logging.

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. The package installs cleanly in a non-Laravel project too - the provider class is only loaded by Laravel’s own discovery.