Ошибка сброса пароля при использовании laravel 5.2. (Последний шаг)

рабочая часть:

Забыли пароль, ссылка работает.

Сброс пароля, ссылка отправлена ​​на почту, работает.

Перенаправление на страницу сброса пароля работает.

Не рабочая часть:

при нажатии на кнопку сброса пароля возникает следующая ошибка:

MethodNotAllowedHttpException в строке 218 RouteCollection.php:

Мой UserController:

      public function forget(){

if(isset($_POST['email']))
{

$checkemail=User::forget($_POST['email']);
if($checkemail[0]){
$sendemail =  Mail::send('emails.reset', ['code' => $checkemail[1]->code], function($message) {
$message->to(Input::get('email'))
->subject('Password Reset');});return redirect()->back();

}
else{\Session::flash('message','Email  not found'); return redirect()-   >back();}
}
else{

return view('forget');}}

public function reset($code=null)
{return view('resetpass')->with('code',$code);
//$checkcode=User::reset($code);

}public function resetpwd()
{

$resetpwd = User::resetpwd(Input::all());

if($resetpwd){echo "updated";}
}

Моя модель User.php:

                 public static function forget($email)
{
$emailpar=DB::table('users')->where('email','=',$email)->first();
if($emailpar){return array(true,$emailpar);}
else {return array(false);}
}

public static function resetpwd($user)
{
$updatepassword = DB::table('users')->where('code' ,'=' , $user->code)->update('password' => $user->password);

if($updatepassword){return true;}

else{return false;}

}

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector