imaximius/forgot-password-bundle
A PHP bundle that adds a complete forgot-password flow: request reset links, generate and validate secure tokens, send reset emails, and update passwords. Configurable templates and storage make it easy to integrate into existing applications.
This is not a Laravel package — it's a Symfony2-era bundle (a fork of coop-tilleuls/forgot-password-bundle). Before writing a single line of Laravel code, decide where it will live:
AppKernel/bundles.php registration, and Symfony's DI container. It will not autoload or boot inside a Laravel app without a compatibility shim. If your app is pure Laravel, treat this repository as a reference implementation, not a dependency.README.md — the public contract (routes, config keys, events).DependencyInjection/Configuration.php — every config knob (password_request_entity_class, user_entity_class, token TTL, mailer).Controller/ForgotPasswordController.php — the two endpoints: request-a-token and reset-with-token.Mailer/ + Event/ — the extension surface most forks touch.POST /forgot-password with a username/email → generate a token, persist a PasswordRequest, email a reset link → POST /forgot-password/{token} with a new password → fire a reset event.If you are maintaining a legacy Symfony service that already has this bundle, the minimal path is: composer require imaximius/forgot-password-bundle, register the bundle, import its routing, map your User entity in config, and provide a mailer implementation. In a Laravel-only codebase, skip the install and map the concepts onto Laravel's native Password broker (sendResetLink, reset, passwords table) — you get the same flow with far less surface area.
Core Symfony workflow (if you must run the bundle directly):
password_request_entity_class (usually your own entity extending the bundle's base) and a user_entity_class.token_ttl deliberately (short — 15–60 minutes) and wire your own MailerInterface implementation, because the default is a no-op/stub.ForgotPasswordEvents (REQUEST_PASSWORD, RESET_PASSWORD, invalid-token events) to invalidate sessions, log attempts, or trigger "password changed" notifications.anonymous: true for the request route but restricts the reset route to a signed/validated token.Laravel-native equivalent (recommended for day-to-day):
// Request
Password::sendResetLink($request->only('email'));
// Reset
Password::reset($request->only('email','password','password_confirmation','token'), function ($user, $password) {
$user->forceFill(['password' => Hash::make($password)])->save();
event(new PasswordReset($user));
});
Override App\Models\User::sendPasswordResetNotification() to point at a custom ResetPassword notification so you control branding, expiry text, and the signed URL. This is the pattern the bundle is emulating; use it unless you are contractually locked into Symfony.
Integration tips if you keep both worlds:
PasswordRequest concept as a Laravel table (password_resets is already there) so analytics and rate-limiting can be shared.RateLimiter or Symfony's login_throttling) so token-guessing and email-enumeration behavior is consistent.coop-tilleuls/forgot-password-bundle — diff it against upstream before trusting it.MailerInterface. A silent no-op mailer is the most common "forgot password doesn't work" report.PasswordRequest and mark it consumed inside the same transaction as the password update./forgot-password route; check bin/console debug:router (Symfony) or php artisan route:list (Laravel if proxying).PasswordRequest entity. Anything beyond that is fighting the framework.debug:container CoopTilleulsForgotPassword and check the event listeners; in Laravel, log Password::sendResetLink response constants (RESET_LINK_SENT, INVALID_USER, RESET_THROTTLED) — that status code is where 90% of issues surface.How can I help you explore Laravel packages today?