Skip to content

Instantly share code, notes, and snippets.

@savepong
Created December 5, 2018 08:20
Show Gist options
  • Save savepong/413db7780a1705ec9e81d5ee35e52f47 to your computer and use it in GitHub Desktop.
Save savepong/413db7780a1705ec9e81d5ee35e52f47 to your computer and use it in GitHub Desktop.
ฟังก์ชั่นเช็คชื่อ Route ที่กำลังเปิดอยู่
<?php
if (! function_exists('routeIsActive')) {
function routeIsActive($routes, $print = 'active'){
if (is_array($routes)) {
foreach ($routes as $route) {
if(Route::is($route)){
return $print;
}
}
return '';
}
return Route::is($routes) ? $print : '';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment