admin管理员组文章数量:1356443
I want to reload my current page with onclick function, for this how to get my current route name in blade file.
This is my code:
<li class="dropdown user user-menu" onclick="window.location='{{ Route::current() }}'" style="cursor: pointer;">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="livicon" data-name="refresh" data-loop="true" data-color="#42aaca"
data-hovercolor="#42aaca" data-size="28"></i>
</a>
</li>
What is the best way to get the current route?
I want to use it on function onclick
.
I want to reload my current page with onclick function, for this how to get my current route name in blade file.
This is my code:
<li class="dropdown user user-menu" onclick="window.location='{{ Route::current() }}'" style="cursor: pointer;">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="livicon" data-name="refresh" data-loop="true" data-color="#42aaca"
data-hovercolor="#42aaca" data-size="28"></i>
</a>
</li>
What is the best way to get the current route?
I want to use it on function onclick
.
3 Answers
Reset to default 3With Below code you can know more about your current route.
$route = Route::current();
$name = Route::currentRouteName();
$action = Route::currentRouteAction();
Reference : Link
Hope it will help!
Best way to get current url in Laravel blade:
onclick="window.location='{{ Request::url() }}'"
You can reload current page like this:
onclick="window.location.reload()"
There is no need to set current route in blade it's possible with javascript abilities.
本文标签: javascripthow to get current route name in blade file laravel 56Stack Overflow
版权声明:本文标题:javascript - how to get current route name in blade file laravel 5.6 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743973483a2570784.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论