Php 在Laravel API中重用重置密码

Php 在Laravel API中重用重置密码,php,laravel-5.7,Php,Laravel 5.7,我正在尝试将Laravel(illumb\Foundation\Auth\SendsPasswordResetEmails)中的重置密码重新用于我正在使用的表单 控制器 public函数重置密码($id) { $user=DB::table('users')->where('id',$id)->first(); SendsPasswordResetEmails::sendResetLinkEmail($user->email); return back()->带有('success','Pass

我正在尝试将Laravel(illumb\Foundation\Auth\SendsPasswordResetEmails)中的重置密码重新用于我正在使用的表单

控制器

public函数重置密码($id)
{
$user=DB::table('users')->where('id',$id)->first();
SendsPasswordResetEmails::sendResetLinkEmail($user->email);
return back()->带有('success','Password已通过电子邮件发送');
}
我得到的错误是:

非静态法 照亮\Foundation\Auth\SendsPasswordResetEmails::sendResetLinkEmail() 不应静态调用


如错误所示,您不应该为
sendResetLinkEmail
函数调用静态方式。您可以使用以下代码:

public function resetPassword($id)
{
        $user = DB::table('users')->where('id', $id)->first();
        $sendResetObject = new SendsPasswordResetEmails();
        $sendResetObject->sendResetLinkEmail($user->email);

        return back()->with('success', 'Password has been sent on email.');
}

希望对您有所帮助。

我已经应用了该功能,但出现了此错误
无法实例化trait-illumb\Foundation\Auth\SendsPasswordResetEmails