[8.x] Add extra method in PasswortReset for reset URL to match the structure of VerifyEmail #39652
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.
Hi,
In a current project, I need to overwrite some methods of the default Laravel notifications (ResetPassword and VerifyEmail).
I noticed that VerifyEmail has an extra method to generate the URL, which is nice. But ResetPassword doesn't have this extra method.
As it provides a convenient way to overwrite just the URL creation method, I thought this could be useful for others to have in the ResetPassword notifications as well. I know you can overwrite things with
$toMailCallback
and$createUrlCallback
but these are not usable when queueing these notifications (Queued jobs do not run in the same thread, so the static values get lost).What changed:
$toMailCallback
(as VerifyEmail passes the created url).I didn't add any tests, as it does not change the logic, it only changes the inner structure of the notification to make it easier to overwrite the URL generation method.
I hope this is a meaningful adjustment...