Laravel - 找不到您要查找的页面

Laravel - The page you are looking for could not be found

当我点击 link

时出现了 404 页

我不知道哪一部分是错的,谁能帮帮我?

sidenav

<a href="{{ route('posts.indexRequest') }}">Request List</a>

路线

Route::prefix('dashboard')->middleware('role:superadministrator|administrator|editor|author|contributor')->group( function () {
  Route::get('/', 'PagesController@dashboard')->name('dashboard');
  Route::resource('/posts', 'PostController');
  Route::get('/posts/request-list', 'PostController@indexRequest')->name('posts.indexRequest');
});

Post 控制器

public function indexRequest()
{
  $posts = Post::where('status', 'On Request')->orderBy('created_at')->paginate(12);

  return view('manages.posts.request', compact('posts'));
}

我有风景

您是否尝试过直接访问您的 "app-link/posts/request-list"

如果资源路由使用相同的前缀,则不能在资源路由之后设置获取路由。

资源路由将posts/{post}定义为PostController@show路由,相当于:

Route::get('posts/{post}', 'PostController@show')

这将与您的底部路线和posts/request-list发生冲突,并将request-list评估为上述路线中的post ID ({post})。

在资源路由之前设置所有特定路由。