这是我的代码
use Illuminate\Foundation\Auth\ResetsPasswords;
class PasswordController extends Controller {
use ResetsPasswords;
public function postReset(Request $request){
// do some stuff
// ...
return parent::postReset($request); // <-here is the problem
}
方法postReset存在于ResetsPasswords中,但是我编写的代码正在Controller类中寻找该方法.
有任何想法吗?
解决方法:
use Illuminate\Foundation\Auth\ResetsPasswords;
class PasswordController extends Controller {
use ResetsPasswords {
ResetsPassword::postReset as traitPostReset;
};
public function postReset(Request $request){
// do some stuff
// ...
return $this->traitPostReset($request);
}
}