jeudi 1 février 2018

How to pass a route parameter to a custom password reset notification in laravel?

Can anyone please shed some light on this?

I have defined custom routes for password reset, which has a route parameter

Route::post('{school}/password/email', 'Web\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
Route::get('{school}/password/reset', 'Web\ForgotPasswordController@showLinkRequestForm')->name('password.request');
Route::post('{school}/password/reset', 'Web\ResetPasswordController@reset')->name('password.reset.submit');
Route::get('{school}/password/reset/{token?}', 'Web\ResetPasswordController@showResetForm')->name('password.reset');

Wondering how to pass the school route parameter to the sendPasswordResetNotification inside my user model where I have specified the custom notification for password reset

public function sendPasswordResetNotification($token)
{
    $school = ''; //How do I access the school route parameter in here? Is there a way to pass the route parameter to the sendPasswordResetNotification function?
    $this->notify(new SchooUserPasswordResetNotification($token, $school));
}

Any help will be deeply appreciated.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire