我的应用程序存在问题。
我正在尝试将密码重置链接从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));*/
}
有什么我想念的吗?