@php $catAvailable = true; if ($link["type"] == 'services-megamenu' && serviceCategory()) { $data = $currentLang->megamenus()->where('type', 'services')->where('category', 1); $cats = $currentLang->scategories()->where('status', 1)->orderBy('serial_number', 'ASC')->get(); $catModel = '\App\Scategory'; $itemModel = '\App\Service'; $allUrl = route("front.services"); } elseif ($link["type"] == 'products-megamenu') { $data = $currentLang->megamenus()->where('type', 'products')->where('category', 1); $cats = $currentLang->pcategories()->where('status', 1)->get(); $catModel = '\App\Pcategory'; $itemModel = '\App\Product'; $allUrl = route("front.product"); } elseif ($link["type"] == 'portfolios-megamenu' && serviceCategory()) { $data = $currentLang->megamenus()->where('type', 'portfolios')->where('category', 1); $cats = $currentLang->scategories()->where('status', 1)->get(); $catModel = '\App\Scategory'; $itemModel = '\App\Portfolio'; $allUrl = route('front.portfolios'); } elseif ($link["type"] == 'services-megamenu' && !serviceCategory()) { $data = $currentLang->megamenus()->where('type', 'services')->where('category', 0); $itemModel = '\App\Service'; $catAvailable = false; } elseif ($link["type"] == 'portfolios-megamenu' && !serviceCategory()) { $data = $currentLang->megamenus()->where('type', 'portfolios')->where('category', 0); $itemModel = '\App\Portfolio'; $catAvailable = false; } elseif ($link["type"] == 'courses-megamenu') { $data = $currentLang->megamenus()->where('type', 'courses')->where('category', 1); $cats = $currentLang->course_categories()->where('status', 1)->get(); $catModel = '\App\CourseCategory'; $itemModel = '\App\Course'; $allUrl = route("courses"); } elseif ($link["type"] == 'causes-megamenu') { $data = $currentLang->megamenus()->where('type', 'causes')->where('category', 0); $itemModel = '\App\Donation'; $catAvailable = false; } elseif ($link["type"] == 'events-megamenu') { $data = $currentLang->megamenus()->where('type', 'events')->where('category', 1); $cats = $currentLang->event_categories()->where('status', 1)->get(); $catModel = '\App\EventCategory'; $itemModel = '\App\Event'; $allUrl = route("front.events"); } elseif ($link["type"] == 'blogs-megamenu') { $data = $currentLang->megamenus()->where('type', 'blogs')->where('category', 1); $cats = $currentLang->bcategories()->where('status', 1)->get(); $catModel = '\App\Bcategory'; $itemModel = '\App\Blog'; $allUrl = route("front.blogs"); } if ($data->count() > 0) { $megaMenus = $data->first()->menus; $megaMenus = json_decode($megaMenus, true); } else { $megaMenus = []; } // dd($megaMenus); @endphp @includeIf('front.partials.mobile-mega-menu')