1
我有這些路線:卸下從驗證::路由的路由()
Auth::routes();
Route::get('/home', '[email protected]');
Route::get('/', '[email protected]');
Auth::routes()
由命令php artisan make::auth
生成。但是,我不希望索引頁面位於auth中間件組中,即上面列表中的第三條路徑。
這裏是控制器的方法。 index()
適用於所有人,home()
適用於經過認證的用戶。
public function index()
{
return view('index');
}
public function home()
{
return view('home')->with('message','Logged in!');
}
登錄系統的用戶會被重定向到主頁網址
protected $redirectTo = '/home';
但每當我運行第三個路徑出現的登錄頁面。那麼,我如何從auth中間件組中刪除該路由。
請稍微解釋一下你的問題,不清楚你在詢問關於你想要直接回家的 –
而不是索引頁面? –
@recoverymen no。我不想'Route :: get('/','LibraryController @ index'); '路由到auth中間件。 – Steve