class EnsureFrontendRequestsAreStateful

Properties

static protected null|Request): array<int, string> $statefulDomainsResolver

The closure used to resolve stateful domains for the current request.

Methods

Response
handle(Request $request, Closure $next)

Handle the incoming requests.

array
frontendMiddleware()

Get the middleware that should be applied to requests from the "frontend".

static bool
fromFrontend(Request $request)

Determine if the given request is from the first-party application frontend.

static void
resolveStatefulDomainsUsing(Closure|null $callback)

Register a closure that resolves stateful domains for the current request.

static void
flushState()

Flush all static state.

Details

at line 27
Response handle(Request $request, Closure $next)

Handle the incoming requests.

Parameters

Request $request
Closure $next

Return Value

Response

at line 44
protected array frontendMiddleware()

Get the middleware that should be applied to requests from the "frontend".

Return Value

array

at line 74
static bool fromFrontend(Request $request)

Determine if the given request is from the first-party application frontend.

Parameters

Request $request

Return Value

bool

at line 133
static void resolveStatefulDomainsUsing(Closure|null $callback)

Register a closure that resolves stateful domains for the current request.

Boot-only. The closure receives the current request and returns the stateful domain list; useful when the list varies by host or other request data. Persists for the worker lifetime.

Parameters

Closure|null $callback

Return Value

void

at line 141
static void flushState()

Flush all static state.

Return Value

void