@if (\Session::has('admin'))
@foreach ($menuData[0]->menu as $menu)
{{-- adding active and open class if child is active --}}
{{-- menu headers --}}
@if (isset($menu->menuHeader))
{{ __($menu->menuHeader) }}
@else
{{-- active menu method --}}
@php
$activeClass = null;
$currentRouteName = Route::currentRouteName();
if ($currentRouteName === $menu->slug) {
$activeClass = 'active';
}
elseif (isset($menu->submenu)) {
if (gettype($menu->slug) === 'array') {
foreach($menu->slug as $slug){
if (str_contains($currentRouteName,$slug) and strpos($currentRouteName,$slug) === 0) {
$activeClass = 'active open';
}
}
}
else{
if (str_contains($currentRouteName,$menu->slug) and strpos($currentRouteName,$menu->slug) === 0) {
$activeClass = 'active open';
}
}
}
@endphp
{{-- main menu --}}
@endif
@endforeach
@else
@if(Session::get('domains')<=1)
@foreach ($menuData[0]->menuBusinessSimple as $menu)
{{-- adding active and open class if child is active --}}
{{-- menu headers --}}
@if (isset($menu->menuHeader))
{{ __($menu->menuHeader) }}
@else
{{-- active menu method --}}
@php
$activeClass = null;
$currentRouteName = Route::currentRouteName();
if ($currentRouteName === $menu->slug) {
$activeClass = 'active';
}
elseif (isset($menu->submenu)) {
if (gettype($menu->slug) === 'array') {
foreach($menu->slug as $slug){
if (str_contains($currentRouteName,$slug) and strpos($currentRouteName,$slug) === 0) {
$activeClass = 'active open';
}
}
}
else{
if (str_contains($currentRouteName,$menu->slug) and strpos($currentRouteName,$menu->slug) === 0) {
$activeClass = 'active open';
}
}
}
@endphp
{{-- main menu --}}
@if ( \Session::get('business.phone') != '')
@endif
@endif
@endforeach
@else
@foreach ($menuData[0]->menuBusiness as $menu)
{{-- adding active and open class if child is active --}}
{{-- menu headers --}}
@if (isset($menu->menuHeader))
{{ __($menu->menuHeader) }}
@else
{{-- active menu method --}}
@php
$activeClass = null;
$currentRouteName = Route::currentRouteName();
if ($currentRouteName === $menu->slug) {
$activeClass = 'active';
}
elseif (isset($menu->submenu)) {
if (gettype($menu->slug) === 'array') {
foreach($menu->slug as $slug){
if (str_contains($currentRouteName,$slug) and strpos($currentRouteName,$slug) === 0) {
$activeClass = 'active open';
}
}
}
else{
if (str_contains($currentRouteName,$menu->slug) and strpos($currentRouteName,$menu->slug) === 0) {
$activeClass = 'active open';
}
}
}
@endphp
{{-- main menu --}}
@if ( \Session::get('business.phone') != '')