class RequirePassword (View source)

Properties

protected ResponseFactory $responseFactory

The response factory instance.

protected UrlGenerator $urlGenerator

The URL generator instance.

protected int $passwordTimeout

The password timeout.

Methods

void
__construct(ResponseFactory $responseFactory, UrlGenerator $urlGenerator, int|null $passwordTimeout = null)

Create a new middleware instance.

static string
using(string|null $redirectToRoute = null, string|int|null $passwordTimeoutSeconds = null)

Specify the redirect route and timeout for the middleware.

mixed
handle(Request $request, Closure $next, string|null $redirectToRoute = null, string|int|null $passwordTimeoutSeconds = null)

Handle an incoming request.

bool
shouldConfirmPassword(Request $request, int|null $passwordTimeoutSeconds = null)

Determine if the confirmation timeout has expired.

Details

void __construct(ResponseFactory $responseFactory, UrlGenerator $urlGenerator, int|null $passwordTimeout = null)

Create a new middleware instance.

Parameters

ResponseFactory $responseFactory
UrlGenerator $urlGenerator
int|null $passwordTimeout

Return Value

void

static string using(string|null $redirectToRoute = null, string|int|null $passwordTimeoutSeconds = null)

Specify the redirect route and timeout for the middleware.

Parameters

string|null $redirectToRoute
string|int|null $passwordTimeoutSeconds

Return Value

string

mixed handle(Request $request, Closure $next, string|null $redirectToRoute = null, string|int|null $passwordTimeoutSeconds = null)

Handle an incoming request.

Parameters

Request $request
Closure $next
string|null $redirectToRoute
string|int|null $passwordTimeoutSeconds

Return Value

mixed

protected bool shouldConfirmPassword(Request $request, int|null $passwordTimeoutSeconds = null)

Determine if the confirmation timeout has expired.

Parameters

Request $request
int|null $passwordTimeoutSeconds

Return Value

bool