lundi 21 septembre 2015

How do I send a French version of the Password Reset Email in Laravel?

I am new to laravel. I am building an App that supports French and English language using laravel 5. I have successfully followed the documentation to implement the English version. Now I have troubled implementing the French equivalent. Looking at the Laravel code fragment below:

public function postEmail(Request $request)
    {
        $this->validate($request, ['email' => 'required|email']);

        $response = Password::sendResetLink($request->only('email'), 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(['email' => trans($response)]);
        }
    }

I noticed that there is a method sendResetLink which takes an array of credentials and a closure, but I have not seen where laravel passes the message in views/email/password.blade.php to this function so that is sent to the users email. How can I go about this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire