0

I had a if statement that return 'active active-c' if the getName is true, but the problem is i wanna put two value on it so I do this:

@if (Route::current()->getName() === 'sonyForm' || 'warnerForm') active active-c @endif

But that ain't work well, how to do that properly?

2 Answers2

2

The other option is to ask the route to check if it matches a set of patterns for the name:

@if (Route::current()->named('sonyForm', 'warnerForm'))
lagbox
  • 48,571
  • 8
  • 72
  • 83
1
@if (in_array(Route::current()->getName(), ['sonyForm', 'warnerForm'])) 
    active active-c 
@endif
Harven
  • 608
  • 6
  • 15