public function redirectPath() { if (method_exists($this, 'redirectTo')) { return $this->redirectTo(); } return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home'; } 因此,本部分文档仅适用于Laravel 5.3.29版和更高版本 受保护的函数redirectTo(){//} protected function redirectTo() { // } v5.3.28解决方案 要使redirectTo()方法在v5.3.28中工作,请在src/Illuminate/Foundation/Auth/RedirectsUsers.php中的redirectPath()方法中手动添加此方法.To make redirectTo() method work in v5.3.28, manually add this in redirectPath() method in src/Illuminate/Foundation/Auth/RedirectsUsers.php.if (method_exists($this, 'redirectTo')) { return $this->redirectTo();} 这篇关于Laravel的redirectTo()方法发生了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-19 08:18