Laravel 路由:获取当前路由 Draft
访问当前路由
你可以使用 Route facade 上的 current 、 currentRouteName 和 currentRouteAction 方法来访问处理传入请求的路由的信息:
$route = Route::current();
$name = Route::currentRouteName();
$action = Route::currentRouteAction();
如果你想知道所有可访问的方法,可以查看 API 文档,了解 Route facade 和 Route 实例 的基础类。
继续写起啊
$name = Route::currentRouteName();始终是空的