@php $path = '/'.Request::path(); // url 마지막이 int 일 경우 게시글 id로 판단하여 제거 $arrPath = explode('/', $path); $lastTypeof = (int)$arrPath[count($arrPath)-1]; if ($lastTypeof) { array_pop($arrPath); $path = implode('/', $arrPath); } $currentMenu = Menu::where([['enable', '=', 'Y'],['type', '!=', 'gnb'],['type', '!=', 'mask'],['url', '=', $path]])->first(); @endphp @if (!empty($currentMenu) && $currentMenu->type != 'submain' && $currentMenu->code != 'PROGRAMS' && $currentMenu->code != 'SCHOOLPICK' && $currentMenu->code != 'JUNIOR') @php $ancestors = $currentMenu->ancestors->pluck('children'); $depth = $ancestors->count(); if ($depth < 4) { // 모바일 4depth 포지션 맞추기 for ($i = $depth; $i < 4; $i++) { $ancestors->push([]); } } $level = $currentMenu->ancestors->pluck('name'); $level->push($currentMenu->name); @endphp
@endif