在我的laravel應用程序中,有一些奇怪的事情發生,我有這樣的想法,當用戶有一個活動的會話,一些如何應用程序沒有讓用戶去登錄頁面的形式。例如,如果im登錄到我的應用程序,然後進入登錄頁面,我希望im重定向到儀表板,因爲我有一個實時會話。重定向登錄頁面如果會話存活
出了什麼問題?
我的路線:
// Login and Dashboard route
Route::get('/', '[email protected]');
Route::get('dashboard', '[email protected]');
//Authentication Routes
Route::get('auth/login', 'Auth\[email protected]');
Route::post('auth/login', 'Auth\[email protected]');
Route::get('auth/logout', 'Auth\[email protected]');
我laravel版本是5.2
如果你在登錄頁面時進入登錄頁面,該應用是否將你重定向到儀表板? – user3158900
在路由中使用'Auth :: check()'。如果你添加一個Route :: group([「middleware」=>「guest」],function(){...},這將幫助你http://laravelbook.com/laravel-user-authentication/ – Manish
);''在你的'auth/login'路由周圍,如果你登錄的話,它會自動將你從登錄名重定向。 –