【问题标题】:Laravel: How do I get the current routeLaravel:我如何获得当前路线
【发布时间】:2020-08-04 21:43:32
【问题描述】:

如何获取用户当前所在的路线?如果用户当前在链接指向的路线上,我需要它来隐藏导航栏链接。

【问题讨论】:

标签: php laravel


【解决方案1】:

您可以使用 current、currentRouteName 和 currentRouteAction 方法来访问有关处理传入请求的路由的信息:

$route = Route::current();
$name = Route::currentRouteName();
$action = Route::currentRouteAction();

你也可以查看Link

希望对你有帮助...

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-08-03
    • 1970-01-01
    • 2015-12-04
    • 2015-10-08
    • 2019-05-03
    • 2015-07-14
    • 2016-04-08
    • 2020-04-18
    相关资源
    最近更新 更多