Created
August 19, 2015 09:21
-
-
Save ClaudioVarandas/fa19e1019ac72a31dc79 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Laravel Helpers */ | |
class Helpers | |
{ | |
public static function setActive($paths = [], $active = 'active') | |
{ | |
$isActive = false; | |
foreach ($paths as $path) { | |
if (Request::is($path)) { | |
$isActive = true; | |
} | |
} | |
return $isActive ? 'class="active"' : ''; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment