Answer the question
In order to leave comments, you need to log in
How to override the handle method in the RequirePassword middleware?
Greetings.
Please tell me how to override the RequirePassword::handle () method from the vendor in custom classes ( vendor\laravel\framework\src\Illuminate\Auth\Middleware\RequirePassword.php ):
public function handle($request, Closure $next, $redirectToRoute = null)
{
if ($this->shouldConfirmPassword($request)) {
if ($request->expectsJson()) {
return $this->responseFactory->json([
'message' => 'Password confirmation required.',
], 423);
}
return $this->responseFactory->redirectGuest(
$this->urlGenerator->route($redirectToRoute ?? 'password.confirm')
);
}
return $next($request);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question