@php $currentPath = '/' . Request::path(); if (Illuminate\Support\Str::contains($currentPath, '/module/')) { $pathParts = explode('/', $currentPath); // Buat ulang URL hanya dengan bagian kedua dan ketiga, misal: /presisi/keluarga $newUrl = '/presisi/' . ($pathParts[2] ?? ''); if($menu = App\Models\CMS\Menu::where('url', $newUrl)->where('menu_type', 2)->orderBy('id', 'desc')->first()) { echo $menu->name.' - '; } }else{ echo App\Models\CMS\Menu::where('url', str_replace('statistik-', '/presisi/', Request::path()))->where('menu_type', 2)->orderBy('id', 'desc')->first()->name ?? ''; } @endphp {{App\Models\CMS\Menu::where('url', '/'.Request::path())->where('menu_type', 2)->orderBy('id', 'desc')->first()->name ?? ''}}

{{-- Demografi E-Stunting --}} {!! generateMenuPresisi((new \App\Http\Repository\CMS\MenuRepository)->tree(2)) !!}