From a746384976f2077704d5b49c8dae11d77ae22d83 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 18 Jan 2023 15:13:18 +1100 Subject: [PATCH] highlight sidebar menu when viewing entity in client portal --- app/Helpers/ClientPortal.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Helpers/ClientPortal.php b/app/Helpers/ClientPortal.php index 80c174ebf66b..d635a1aea65e 100644 --- a/app/Helpers/ClientPortal.php +++ b/app/Helpers/ClientPortal.php @@ -24,6 +24,9 @@ use Illuminate\View\View; function isActive($page, bool $boolean = false) { $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) { return true; @@ -33,6 +36,12 @@ function isActive($page, bool $boolean = false) return 'bg-gray-200'; } + if(($page == $show) && $boolean){ + return true; + } + + + return false; }