highlight sidebar menu when viewing entity in client portal

This commit is contained in:
David Bomba 2023-01-18 15:13:18 +11:00
parent 55fec84e1d
commit a746384976

View File

@ -24,6 +24,9 @@ use Illuminate\View\View;
function isActive($page, bool $boolean = false) function isActive($page, bool $boolean = false)
{ {
$current_page = Route::currentRouteName(); $current_page = Route::currentRouteName();
$action = Route::currentRouteAction(); // string
$show = str_replace(['.show','payment_methodss','documentss','subscriptionss'],['s.index','payment_methods','documents','subscriptions'], $current_page);
if ($page == $current_page && $boolean) { if ($page == $current_page && $boolean) {
return true; return true;
@ -33,6 +36,12 @@ function isActive($page, bool $boolean = false)
return 'bg-gray-200'; return 'bg-gray-200';
} }
if(($page == $show) && $boolean){
return true;
}
return false; return false;
} }