mercredi 30 décembre 2015

Laravel - How to pass variable to reset password template?

I have implemented reset password functionality with Laravel 5 and getting email. Now how to pass some variable data to my email template to display more information about user.

/**
 * Send a reset link to the given user.
 *
 * @param  \Illuminate\Http\Request  $request
 * @return \Illuminate\Http\Response
 */
public function postEmail(Request $request)
{
    //echo Input::get('ID'); die;
    $this->validate($request, ['ID' => 'required|email']);

    $UserProduct = "Sample 1"; // I want to pass this variable to my password.blade.php
    $response = Password::sendResetLink($request->only('ID'), function (Message $message) {
        $message->subject($this->getEmailSubject());
    });

    switch ($response) {
        case Password::RESET_LINK_SENT:
            return redirect()->back()->with('status', trans($response));

        case Password::INVALID_USER:
            return redirect()->back()->withErrors(['ID' => trans($response)]);
    }

}

I want to print $UserProduct = "Sample 1"; to my email template but don't know how to pass to the password.blade page.

Any idea?

Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire