class PreventRequestsDuringMaintenance

Traits

Properties

protected array<int, string> $except

The URIs that should be excluded.

static protected array<int, string> $neverPrevent

The URIs that should be accessible during maintenance.

Methods

bool
inExceptArray(Request $request)

Determine if the request has a URI that should be excluded.

array
getExcludedPaths()

Get the URIs that should be excluded.

__construct(Application $app)

Create a new middleware instance.

mixed
handle(Request $request, Closure $next)

Handle an incoming request.

bool
hasValidBypassCookie(Request $request, array $data)

Determine if the incoming request has a maintenance mode bypass cookie.

mixed
bypassResponse(string $secret)

Redirect the user to their intended destination with a maintenance mode bypass cookie.

array
getHeaders(array $data)

Get the headers that should be sent with the response.

static void
except(array|string $uris)

Indicate that the given URIs should always be accessible.

static void
flushState()

Flush all static state.

Details

in ExcludesPaths at line 14
protected bool inExceptArray(Request $request)

Determine if the request has a URI that should be excluded.

Parameters

Request $request

Return Value

bool

at line 137
array getExcludedPaths()

Get the URIs that should be excluded.

Return Value

array

at line 37
__construct(Application $app)

Create a new middleware instance.

Parameters

Application $app

at line 47
mixed handle(Request $request, Closure $next)

Handle an incoming request.

Parameters

Request $request
Closure $next

Return Value

mixed

Exceptions

HttpException

at line 100
protected bool hasValidBypassCookie(Request $request, array $data)

Determine if the incoming request has a maintenance mode bypass cookie.

Parameters

Request $request
array $data

Return Value

bool

at line 113
protected mixed bypassResponse(string $secret)

Redirect the user to their intended destination with a maintenance mode bypass cookie.

Parameters

string $secret

Return Value

mixed

at line 123
protected array getHeaders(array $data)

Get the headers that should be sent with the response.

Parameters

array $data

Return Value

array

at line 148
static void except(array|string $uris)

Indicate that the given URIs should always be accessible.

Boot-only. The list persists in a static property for the worker lifetime and applies to every subsequent request.

Parameters

array|string $uris

Return Value

void

at line 158
static void flushState()

Flush all static state.

Return Value

void