Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. // ВЫВОД ВО ВЬЮХУ
  2. <ul class="{{$ul_child_class}}">
  3. @foreach($menu_top_items as $item)
  4. <li>
  5. <a href="/{{ $item->path }}">{{ $item->name }}</a>
  6. @if(count($item->children) > 0 )
  7. @include('vendor.shop.layouts.header.nav-menu.nav', [
  8. 'menu_top_items_children' => collect($item->children->all())
  9. ])
  10. @endif
  11. </li>
  12. @endforeach
  13. </ul>
  14.  
  15.  
  16. // ЗАПРОС В БАЗУ В VIEW COMPOSE
  17. if( Menu::where('id', 1)->first() ) {
  18. $menu_top_items = Menu::where('id', 1)
  19. ->with(['items' => function ($query) {
  20. $query->where([
  21. ['live', 1],
  22. ['parent_id', 0]
  23. ])->with('children');
  24. }])
  25. ->firstOrFail()
  26. ->items
  27. ->sortBy('order');
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement