Laravel 路由,路由未定义

问题描述 投票:0回答:1

我想在登录后转到想要的页面(例如学生页面,而不是主页),但我不知道该怎么做。我试过了,但出现错误:路线 [student] 未定义。

我尝试过更改路线以及路线和视图清洁,但没有任何效果

laravel authentication redirect routes laravel-8
1个回答
0
投票

Route is not defined 表示没有用名称声明的路由

Route::get('/', function () {
    // ...
})->name('student');

只需将名称添加到您用于获取主页的路由

->name('student');

© www.soinside.com 2019 - 2024. All rights reserved.