我一直在使用laravel默认身份验证系统,当用户成功登录和成功注册时,它应该重定向到dashboard
页面。但在我的情况下,当成功注册时,它不会重定向到任何页面,而是会出现以下错误:
RouteCollection.php 中的NotFoundHttpException
而我的routes.php
是:
Route::group(['middleware' => 'web'], function () {
Route::auth();
Route::get('/home', 'HomeController@index');
});
和redirectusers.php
public function redirectPath()
{
if (property_exists($this, 'redirectPath'))
{
return $this->redirectPath;
}
return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';
}
}
您可以覆盖Auth控制器中的redirectTo变量
// AuthController.php
protected $redirectTo = '/home';