ForgotPasswordController ​
File: src/Http/Controllers/Auth/ForgotPasswordController.php
Namespace: Unusualify\Modularous\Http\Controllers\Auth
Extends: Auth\Controller
Traits: SendsPasswordResetEmails
Sends password reset emails using Laravel's built-in password broker. The user enters their email address and receives a link to the ResetPasswordController.
Methods ​
broker(): PasswordBroker ​
Returns the password broker configured for the Modularous auth provider via Modularous::getAuthProviderName().
showLinkRequestForm(): View ​
Renders the "forgot password" form where the user enters their email address. The form schema is built via AuthFormBuilder::buildAuthViewData('forgot_password').
sendResetLinkResponse(Request $request, $response): JsonResponse|RedirectResponse ​
Called when the reset link is sent successfully.
- JSON (Inertia/AJAX): returns a success message with
MessageStage::SUCCESSvariant. - Traditional: redirects back with a
statusflash message.
sendResetLinkFailedResponse(Request $request, $response): JsonResponse|RedirectResponse ​
Called when the reset link cannot be sent (e.g. email not found).
- JSON: returns the error message with
MessageStage::WARNINGvariant. - Traditional: redirects back with the email input preserved and an
emailerror.
Flow ​
User clicks "Forgot Password" on login page
└─ showLinkRequestForm() renders the email form
└─ User submits email
└─ SendsPasswordResetEmails::sendResetLinkEmail() (Laravel trait)
├─ Success → sendResetLinkResponse() → user checks email
└─ Failure → sendResetLinkFailedResponse() → error shownRelated ​
- ResetPasswordController — handles the reset link the user receives
- PasswordController — alternative password reset and first-time password generation
- LoginController — links to this controller from the login form