Support the ongoing development of Laravel.io →
Requests Views Blade
Last updated 2 years ago.
0

I'm not sure if this'll help, but I use

{{ Request::segment(2) == '/user' }}

or something similar

Example of my navigation:

<ul class="nav nav-justified collapse navbar-collapse">
	<li {{ Request::segment(1) == '' ? 'class="active"' : '' }}>{{ HTML::link('/', 'Home') }}</li>
	<li>{{ HTML::link('/', 'What Is Nexus?') }}</li>
	<li class="dropdown">
		<a href="#" class="dropdown-toggle" data-toggle="dropdown">What We Do <span class="caret"></span></a>
		<ul class="dropdown-menu">
			<li>{{ HTML::link('/', 'Lectures') }}</li>
			<li>{{ HTML::link('/', 'Tutoring') }}</li>
		</ul>
	</li>
	<li class="dropdown {{ Request::segment(2) == 'screenshots' || Request::segment(1) == 'resources' ? 'active' : '' }}">
		<a href="#" class="dropdown-toggle" data-toggle="dropdown">Resources <span class="caret"></span></a>
		<ul class="dropdown-menu">
			<li>{{ HTML::link('/resources', 'Helpful Links') }}</li>
			<li {{ Request::segment(2) == 'screenshots' ? 'class="active"' : '' }}>{{ HTML::link('/resources/screenshots', 'Screenshots') }}</li>
		</ul>
	</li>
	<li>{{ HTML::link('/', 'Get In Touch') }}</li>
</ul>
Last updated 2 years ago.
0

Thanks, Ended up using something similar.

I had taught there would be some method to unmatch a route.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

drakkex drakkex Joined 5 Aug 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.