[11.x] Cache token repository#53428
Merged
Merged
Conversation
- store the carbon date as a formatted string - use the existing `delete()` method - simplify constructor and properties
have the `PasswordBrokerManager` pass in expiration as seconds
1 task
browner12
added a commit
to browner12/docs
that referenced
this pull request
Jun 24, 2025
document laravel/framework#53428 I modeled the wording and organization after the `session.md` docs for hopefully a little consistency.
taylorotwell
added a commit
to laravel/docs
that referenced
this pull request
Jul 1, 2025
* document the password reset `cache` driver document laravel/framework#53428 I modeled the wording and organization after the `session.md` docs for hopefully a little consistency. * add note about how we key the entries * formatting --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Password reset tokens are a relatively short lived entity. Currently our only framework option is for them to be stored in the database. This is an okay option, but it's slightly annoying because it's another table to maintain, and makes it more difficult for Laravel to make desired adjustment if they require a schema change.
This PR proposes a new
CacheTokenRepositorywhich will allow the password reset tokens to be handled via cache. IMO cache is a perfect storage medium because it can be more ephemeral, just like the password reset tokens.To enable this new
CacheTokenRepository, adjust yourconfig/auth.phplike so:The
driverkey will activate the new "cache" driver. Thestorekey is optional, although I would recommend creating a dedicated cache store for your password resets to prevent flushing your password resets when refreshing your normal cache. Theexpireandthrottlekey behave as before.If your application has multiple "providers" that all use
emailas their identifier, you also get the added benefit of being able to place them on separate cache stores, thus avoiding an unlikely but possible collision.