@php $locale = app()->getLocale(); $targetLocale = $locale === 'en' ? 'bn' : 'en'; $targetLanguageLabel = $locale === 'en' ? 'বাংলা' : 'English'; // Build URL for current route in the target locale $currentRouteName = Route::currentRouteName() ?? 'home'; $currentParameters = Route::current() ? Route::current()->parameters() : []; $targetParameters = array_merge($currentParameters, ['locale' => $targetLocale]); try { $switchUrl = route($currentRouteName, $targetParameters); } catch (\Throwable $e) { $switchUrl = url('/' . $targetLocale); } $toolRegistry = app(\App\Support\Tools\ToolRegistry::class); $categories = $toolRegistry->getCategories(); @endphp
{{ $targetLanguageLabel }}
{{ __('common.nav.home') }} {{ __('common.nav.tools') }}
{{ __('common.nav.categories') }}
@foreach($categories as $catKey => $catData) {{ __('common.categories.' . $catKey) }} @endforeach