Advertisement
rodro1

Laravel active class

Feb 3rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. Throw this in your helper.php
  2.  
  3. function set_active($path, $active = 'active') {
  4.  
  5. return call_user_func_array('Request::is', (array)$path) ? $active : '';
  6.  
  7. }
  8.  
  9.  
  10.  
  11. <li class="{{ set_active(['about*']) }}"><a href="{{ url('about') }}">About Us</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement