laravel重置密码时找不到对象404错误

时间:2018-10-16 17:09:10

标签: laravel-5 laravel-5.2 laravel-5.6

我的应用程序存在问题。

我正在尝试将密码重置链接从mailtrap服务器发送到我的应用程序。但是我收到此错误:

  

找不到对象404

下面是我的代码:

控制器:

class ResetPasswordController extends Controller
{
//
     use ResetsPasswords;
    protected $redirectTo = 'dashboard';

    public function __construct()
    {
        $this->middleware('Auth');
    }


    public function guard()
    {
        return Auth::guard();
    }

    public function broker()
    {
    return password::broker();
    }
public function showResetForm(Request $request, $token)
{
    return view('users.passwords.reset')->with(
        ['token' => $token, 'email' => $request->email]
    );
    }
}

这是notification类:

     public function toMail($notifiable)
    {
    $notifiable->email = $this->email;
    $url = url('password/reset/{token}'.$this->token);
    return (new MailMessage)
                ->line('you receiving this email because we received a 
 password reset from your account.')
                ->action('Reset Password', $url)
                ->line('Thank you for using our application!');
    } 

这些是路线:

Route::get('password/reset', 'ForgotPasswordController@showLinkRequestForm')
->name('password.request');
Route::post('password/email','ForgotPasswordController@sendResetLinkEmail')
 ->name('password.email');
Route::get('password/reset/{token}', 
'ResetPasswordController@showResetForm')->name('password.reset');
Route::post('password/reset', 'ResetPasswordController@reset');

这是model

 public function sendPasswordResetNotification($token)
{
    //using facade
    Notification::send(new ResetPasswordNotification($token));
    /*$this->notify(new ResetPasswordNotification($token));*/
}

有什么我想念的吗?

0 个答案:

没有答案