Skip to content

Instantly share code, notes, and snippets.

@ClaudioVarandas
Created August 19, 2015 09:21
Show Gist options
  • Save ClaudioVarandas/fa19e1019ac72a31dc79 to your computer and use it in GitHub Desktop.
Save ClaudioVarandas/fa19e1019ac72a31dc79 to your computer and use it in GitHub Desktop.
/* 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