domainName = \App\Helpers\ThemeHelper::getDomainName(); $this->domainUrl = \App\Helpers\ThemeHelper::getDomainUrl(); $theme = config('app.theme', 'b2in'); $this->content = config("content.themes.{$theme}.header", []); } public function toggleMobileMenu() { $this->isMobileMenuOpen = ! $this->isMobileMenuOpen; } public function closeMobileMenu() { $this->isMobileMenuOpen = false; } public function isActiveRoute($url) { $currentPath = request()->path(); $currentPath = '/' . ltrim($currentPath, '/'); // Exact match if ($currentPath === $url) { return true; } // Special handling for home route if ($url === '/' && ($currentPath === '/' || $currentPath === '')) { return true; } // Check if current path starts with the navigation URL (for sub-pages) if ($url !== '/' && str_starts_with($currentPath, rtrim($url, '/'))) { return true; } return false; } public function render() { return view('livewire.web.components.ui.header'); } }