@php $finaCurrentPage = (string) ($currentPage ?? ''); try { $finaMenuItems = app(\App\Services\PublicMenuService::class)->items('main', 'fina'); } catch (\Throwable $e) { $finaMenuItems = []; } $finaNormalizeTitle = static fn ($value): string => strtolower(trim(preg_replace('/\s+/', ' ', (string) $value) ?: '')); $finaReservedActions = ['login', 'log in', 'register', 'registration', 'open account', 'create account', 'sign in']; $finaMenuItems = collect((array) $finaMenuItems) ->reject(static fn (array $item): bool => in_array($finaNormalizeTitle(data_get($item, 'title')), $finaReservedActions, true)) ->values() ->all(); if ($finaMenuItems === []) { $finaMenuItems = [ ['title' => 'Home', 'url' => route('page.home'), 'target' => '_self', 'children' => []], ['title' => 'Markets', 'url' => route('page.markets'), 'target' => '_self', 'children' => []], ['title' => 'Accounts', 'url' => route('page.accounts'), 'target' => '_self', 'children' => []], ['title' => 'MT4 Platform', 'url' => route('page.platform'), 'target' => '_self', 'children' => []], [ 'title' => 'Learn', 'url' => '#', 'target' => '_self', 'children' => [ ['title' => 'FAQs', 'url' => route('page.faq'), 'target' => '_self', 'children' => []], ['title' => 'Risk Disclosure', 'url' => route('page.risk'), 'target' => '_self', 'children' => []], ], ], [ 'title' => 'Company', 'url' => '#', 'target' => '_self', 'children' => [ ['title' => 'About Us', 'url' => route('page.about'), 'target' => '_self', 'children' => []], ['title' => 'Contact', 'url' => route('page.contact'), 'target' => '_self', 'children' => []], ['title' => 'Terms & Conditions', 'url' => route('page.terms'), 'target' => '_self', 'children' => []], ['title' => 'Privacy Policy', 'url' => route('page.privacy'), 'target' => '_self', 'children' => []], ['title' => 'Complaints', 'url' => route('page.complaints'), 'target' => '_self', 'children' => []], ], ], ]; } $finaCurrentUrl = rtrim(url()->current(), '/'); try { $finaCmsSettings = app(\App\Services\CmsSettingsService::class)->get(); $finaLanguageEnabled = data_get($finaCmsSettings, 'language_bar.enabled', 'yes') === 'yes'; } catch (\Throwable $e) { $finaLanguageEnabled = true; } @endphp