Support the ongoing development of Laravel.io →
posted 11 years ago
Requests

Hi !

I have a navigation menu with childrens. So I need to put a class active to the element when is children are active too. It's easy with Request::is(mybasepath*) but you have to hardcode the path. And I want to use Action routes or Named routes. Of course Request::is() doesn't work for that and Route::currentRouteNamed() or Route::currentRouteUses() only work when giving as parameter the exact 'name route' or 'controller action'. So how should I do to check that ?

Thanks !

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.

© 2025 Laravel.io - All rights reserved.