Level 88
What you're doing right now is not persisting in the actual category model. If you want that you need to do something else here.
I'm also not sure what you're trying to achieve here...
Hi all Im tyring to create a set active method for my category selection on my site so far i have the following
<li class="{{ setActiveCategory($category->slug) }}"><a href="{{ route('shop.index', ['category' => $category->slug]) }}">{{$category->name}}</a></li>
function setActiveCategory($category, $output = 'active'){
return request()->category == $category ? $output : '';
}
but i am using pagination so when i got to the second page the active state is removed
domain.com/products?page=2
is there any way to ignore the end of the url?
Please or to participate in this conversation.