I have a helper function.
function setActive($path, $active = 'active')
{
return call_user_func_array('Request::is', (array)$path) ? $active : '';
}
When I go to the site: http://example.net/posts?group=active
, my function is not working and returns an empty string ("").
I use this in my Blade:
class="{{ setActive(['posts?group=active'] }}"
How can I resolve this?
Is this for navigation? You don't need a helper function to achieve that. In your blade, you can just do...
OR