当我登录而不是被重定向到dashboard
时,我被重定向到我的auth控制器中的/
我已注释掉以下行但是我仍然被重定向到错误的位置为什么?
我已经清除缓存php artisan cache:clear
而没有运气
行注释:
protected $redirectTo = '/';
登录功能:
public function postLogin(Request $request)
{
$credentials = $this->getLoginCredentials($request);
if(Auth::attempt($credentials))
{
redirect()->intended('dashboard');
}
return redirect()->back();
}
路线:
Route::group(['namespace' => 'Admin', 'prefix' => 'admin', 'middleware' => 'web'], function() {
/* Admin Auth */
Route::get('login', 'Auth\AuthController@getLogin');
Route::post('login', 'Auth\AuthController@postLogin');
Route::get('register', 'Auth\AuthController@getRegister');
Route::post('register', 'Auth\AuthController@postRegister');
Route::get('logout', 'Auth\AuthController@getLogout');
Route::group(['middleware' => 'auth.admin'], function(){
/*Admin Dashboard Routes */
Route::get('dashboard', 'AdminController@getDashboard');
});
});
答案 0 :(得分:3)
您忘了\2/\1 \2
return
:
redirect()