Finally found out a way to do it! :D
<a class="home-link" @if (Request::path() == 'home') @elseif (Request::url() == Request::root())
data-scroll href="#home" @else href="home"@endif> Home</a>
I compared Request::url to Request::root as root will always return the root, so if current url is root do this code else this. I'm sure there are other better ways, but I'm happy now :D
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community