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
CacheTokenRepository
which 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.php
like so:The
driver
key will activate the new "cache" driver. Thestore
key 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. Theexpire
andthrottle
key behave as before.If your application has multiple "providers" that all use
email
as 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.