Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel - how do you inject variables into the password reminder email

Using Laravel 4.1's new password broker, is there a way to pass some data to the password reminder view? Specifically I want to be able to alter the URL of the password reset view.

Looking here: http://laravel.com/api/source-class-Illuminate.Auth.Reminders.PasswordBroker.html#97-118 I am not sure it is flexible enough to accept data without fully extending this class...

like image 311
phirschybar Avatar asked Feb 14 '23 07:02

phirschybar


1 Answers

Unfortunately the code suggested by searsaw didn't work for me. I think I get something wrong. But I found next solution:

    View::composer('emails.auth.reminder', function($view) use ($user) {
        $view->with([
            'first_name'  => $user->first_name,
            'email'       => $user->email,
            'newPassword' => Input::get('new_password'),
            'logo'         => asset('/images/mail/logo.png'),
            'twitter_img'  => asset('/images/mail/btn_twitter_pressed.png'),
            'facebook_img' => asset('/images/mail/btn_fb_pressed.png')
        ]);
    });

I use this code before Password::remind method

like image 190
Victor Avatar answered Feb 17 '23 11:02

Victor