【发布时间】:2018-07-19 16:04:42
【问题描述】:
如何查看当前路由是否为根页面?
我尝试在刀片文件中键入以下内容:
@if(Route::is('/')
//show something
@else
//show something else
@endif
我也尝试过使用 Route::currentRouteName() 例如
@if(Route::currentRouteName() == '/')
//do something
@else
//do something else
@endif
它似乎在根页面上不起作用。 有替代方法吗?还是root没有路由?
【问题讨论】:
-
root 是什么意思?