Current URL inside @if statements in Laravel

When you need to access the current url inside an if statement in laravel 4 you can do it like the example given below.

@if(Request::url() === 'your url here')
// code
@endif

Another method is:

<li{!!(Request::is('your_url')) ? ' class="active"' : '' !!}>
or
<li @if(Request::is('your_url'))class="active"@endif>

To get the url in the blade you can use current().

<a href="{{url()->current()}}">Current Url</a>

Read more