class InertiaState implements ReplicableContext

Inertia configuration and request state stored in coroutine Context.

Providers configure one boot baseline outside a coroutine. Each request receives an independent copy so request mutations remain isolated in Swoole's long-running worker model.

Constants

CONTEXT_KEY

The coroutine Context key for this state.

Properties

string $rootView

The root Blade template name.

array<array-key, mixed|ProvidesInertiaProperties> $sharedProps

The shared properties included in every Inertia response.

Closure|string|null $version

The asset version resolver or value.

bool|null $encryptHistory

Whether browser history encryption is enabled for this request.

Closure|null $urlResolver

The URL resolver callback for this request.

Closure|null $componentTransformer

The component name transformer callback.

array<string, mixed> $page

The page data for the current request's SSR dispatch.

Response|null $ssrResponse

The cached SSR response for the current request.

bool $ssrDispatched

Whether the SSR gateway has been dispatched for this request.

Closure|bool|null $ssrDisabled

The condition that determines if SSR is disabled for this request.

array<int, string> $ssrExcludedPaths

The paths excluded from SSR for this request.

Methods

static InertiaState
current()

Get the current Inertia state.

Response|null
dispatchSsr()

Dispatch SSR if it has not already been dispatched for this request.

replicate()

Copy all current configuration and request state into an independent object.

Details

at line 95
static InertiaState current()

Get the current Inertia state.

Return Value

InertiaState

at line 118
Response|null dispatchSsr()

Dispatch SSR if it has not already been dispatched for this request.

Return Value

Response|null

at line 131
ReplicableContext replicate()

Copy all current configuration and request state into an independent object.

Return Value

ReplicableContext