2017-05-19 8 views
0

저는 지금까지 해결할 수 없었던 간단한 문제가 있습니다. 문제는 사용자가 비밀번호를 잊어 버렸을 때 이메일이 올바르게 전송된다는 것입니다. 제목. 주제를 추가하고 싶지만 할 수 없습니다. 여기이메일 제목이 Laravel 4

public function postRemind() 
    { 
     $this->reminderForm->validate(Input::only('email')); 
     switch ($response = Password::remind(Input::only('email'))) { 
      case Password::INVALID_USER: 
       return Redirect::back()->with('error', Lang::get($response)); 
      case Password::REMINDER_SENT: 
       return Redirect::back()->with('status', Lang::get($response)); 
     } 
    } 

내 블레이드입니다 : 당신이 제목을 설정할 수 당신은 Password::remind에 폐쇄를 통과 할 수

<!doctype html> 
<html lang="en"> 
<head> 
    <meta charset="UTF-8"> 
</head> 
<body> 
    <h3>Password Reset</h3> 
    <div> 
     You have requested password reset. Complete this form: {{ URL::to('password/reset', array($token)) }} 
    </div> 
</body> 
</html> 

답변

3

여기 내 컨트롤러에서 postRemind 기능입니다.

https://laravel.com/docs/4.2/security#password-reminders-and-reset

public function postRemind() 
{ 
    $this->reminderForm->validate(Input::only('email')); 

    $response = Password::remind(Input::only('email'), function($message) 
    { 
     $message->subject('Password Reminder'); 
    }); 

    switch ($response) { 
     case Password::INVALID_USER: 
      return Redirect::back()->with('error', Lang::get($response)); 
     case Password::REMINDER_SENT: 
      return Redirect::back()->with('status', Lang::get($response)); 
    } 
} 
+0

덕분에 많은 사람이, 완벽하게 일했다. –

+0

@ rooot_999 여러분을 환영합니다. 다행히 도울 수있어. –