Middleware
class Middleware
Properties
| protected string | $rootView | The root template that's loaded on the first page visit. |
|
| protected bool | $withAllErrors | Determines if validation errors should be mapped to a single error message per field. |
|
| protected array<int, string> | $withoutSsr | The paths that should be excluded from server-side rendering. |
Methods
Define a callback that returns the relative URL.
Store the current URL and route as the previous location, which Hypervel's session middleware skips for Inertia visits.
Determine if the visit should be stored as the previous location. Partial reloads are excluded, since deferred props, polling, and infinite scroll requests aren't navigations the user came from.
Determine if the request is a partial reload of the component that was rendered.
Add the Inertia header to the response's Vary list.
Determine if the redirect response contains a URL fragment.
Flush all static state.
Details
at line 58
string|null
version(Request $request)
Determine the current asset version.
The result is cached for the worker lifetime to avoid repeated filesystem I/O on every request.
at line 93
array
share(Request $request)
Define the props that are shared by default.
at line 105
array
shareOnce(Request $request)
Define the props that are shared once and remembered across navigations.
at line 113
string
rootView(Request $request)
Set the root template that is loaded on the first page visit.
at line 121
Closure|null
urlResolver()
Define a callback that returns the relative URL.
at line 211
protected void
storeCurrentUrl(Request $request, Response $response)
Store the current URL and route as the previous location, which Hypervel's session middleware skips for Inertia visits.
at line 228
bool
shouldStoreCurrentUrl(Request $request, Response $response)
Determine if the visit should be stored as the previous location. Partial reloads are excluded, since deferred props, polling, and infinite scroll requests aren't navigations the user came from.
at line 246
protected bool
isPartialReload(Request $request, Response $response)
Determine if the request is a partial reload of the component that was rendered.
at line 259
protected void
addInertiaVaryHeader(Response $response)
Add the Inertia header to the response's Vary list.
at line 271
protected bool
redirectHasFragment(Response $response)
Determine if the redirect response contains a URL fragment.
at line 279
protected void
reflash(Request $request)
Reflash the session data for the next request.
at line 289
Response
onEmptyResponse(Request $request, Response $response)
Handle empty responses.
at line 297
Response
onRedirectWithFragment(Request $request, Response $response)
Handle redirects with URL fragments.
at line 307
Response
onVersionChange(Request $request, Response $response)
Handle version changes.
at line 324
object
resolveValidationErrors(Request $request)
Resolve validation errors for client-side use.
at line 355
static void
flushState()
Flush all static state.