SHARE
TWEET

Untitled

a guest Nov 18th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top