Skip to content

Instantly share code, notes, and snippets.

@jeystaats
Created February 25, 2017 11:24
Show Gist options
  • Save jeystaats/b0de790065f01963a2e07e4d9ea46c66 to your computer and use it in GitHub Desktop.
Save jeystaats/b0de790065f01963a2e07e4d9ea46c66 to your computer and use it in GitHub Desktop.
Return active string if a route is active
<?php
function set_active($path) {
if (strpos(\Request::route()->getName(), $path) !== false) {
return 'active';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment