Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Add extra method in PasswortReset for reset URL to match the structure of VerifyEmail #39652

Merged
merged 1 commit into from
Nov 17, 2021
Merged

[8.x] Add extra method in PasswortReset for reset URL to match the structure of VerifyEmail #39652

merged 1 commit into from
Nov 17, 2021

Conversation

okaufmann
Copy link
Contributor

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:

  • moved the logic for URL creation into an extra method (as VerifyEmail has)
  • added the created URL as fourth parameter to a possibly used closure in $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...

@okaufmann okaufmann changed the title Add extra method in PasswortReset for reset URL to match the structure of VerifyEmail [8.x] Add extra method in PasswortReset for reset URL to match the structure of VerifyEmail Nov 17, 2021
@taylorotwell taylorotwell merged commit e75a59e into laravel:8.x Nov 17, 2021
@okaufmann okaufmann deleted the feature/align-reset-url-creation branch November 17, 2021 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants