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

[10.x] Change ResetPassword::resetUrl() visibility to public static #41530

Closed
wants to merge 1 commit into from

Conversation

crynobone
Copy link
Member

This provide solution for project using ResetPassword::toMailUsing() and ResetPassword::createMailUsing().

For example:

ResetPassword::createUrlUsing(function ($user, string $token) {
    return route('custom.password.reset', $token);
});

ResetPassword::toMailUsing(function ($notifiable, $token) {
    return (new MailMessage)
        ->subject(__('Reset Password Notification'))
        ->line(__('You are receiving this email because we received a password reset request for your account.'))
        ->action(__('Reset Password'), ResetPassword::resetUrl($notifiable, $token))
        ->line(__('If you did not request a password reset, no further action is required.'));
}); 

Signed-off-by: Mior Muhammad Zaki [email protected]

@taylorotwell
Copy link
Member

I guess I don't totally follow why it is necessary? If ResetPassword::resetUrl is just going to call the route helper, why not just do that directly in toMailUsing?

ResetPassword::toMailUsing(function ($notifiable, $token) {
    return (new MailMessage)
        ->subject(__('Reset Password Notification'))
        ->line(__('You are receiving this email because we received a password reset request for your account.'))
        ->action(__('Reset Password'), route('custom.password.reset', $token))
        ->line(__('If you did not request a password reset, no further action is required.'));
}); 

@crynobone
Copy link
Member Author

Yeah, but PR requesting access to the reset URL keep popping up from time to time:

@taylorotwell
Copy link
Member

I still just don't think this is super necessary. 🙃

@crynobone crynobone deleted the reset-password-reset-url branch March 19, 2022 11:05
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.

2 participants