Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ВЫВОД ВО ВЬЮХУ
- <ul class="{{$ul_child_class}}">
- @foreach($menu_top_items as $item)
- <li>
- <a href="/{{ $item->path }}">{{ $item->name }}</a>
- @if(count($item->children) > 0 )
- @include('vendor.shop.layouts.header.nav-menu.nav', [
- 'menu_top_items_children' => collect($item->children->all())
- ])
- @endif
- </li>
- @endforeach
- </ul>
- // ЗАПРОС В БАЗУ В VIEW COMPOSE
- if( Menu::where('id', 1)->first() ) {
- $menu_top_items = Menu::where('id', 1)
- ->with(['items' => function ($query) {
- $query->where([
- ['live', 1],
- ['parent_id', 0]
- ])->with('children');
- }])
- ->firstOrFail()
- ->items
- ->sortBy('order');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement