InertiaState
class InertiaState
Per-request Inertia state stored in coroutine Context.
All request-scoped Inertia state lives here instead of on singleton service classes. This ensures complete isolation between concurrent requests 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<string, mixed> | $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
Set the page data and dispatch SSR if not already dispatched.
Details
at line 100
static Response|null
dispatchSsr(array $page)
Set the page data and dispatch SSR if not already dispatched.
Used by Blade directives and view components to trigger SSR rendering. The result is cached so multiple calls (e.g. both