@foreach ($menu as $value)
  @if(!$value->parent)
    @if($value->url)
      <li><a href="{!! url((string)$value->url) !!}">@if ($value->rDe) {!! $value->rDe->name !!} @endif</a></li>
    @else
    @if(!isset($setting['layout_menu']) || $setting['layout_menu'] == 0)
     <li class="dropdown yamm-fw"><a href="#" data-toggle="dropdown" class="dropdown-toggle">@if ($value->rDe) {!! $value->rDe->name !!} @endif <div class="arrow-up"></div></a>
      <ul class="dropdown-menu" role="menu">
          <div class="yamm-content">
            <div class="row">
          @foreach ($menu as $valuec)
            @if($valuec->parent == $value->id)
            <ul class="col-sm-4" style="text-transform: capitalize;">
              @if($valuec->url)
                @if ($valuec->rDe)
                <li><a href="{!! url((string)$valuec->url) !!}">{!! $valuec->rDe->name !!}</a></li>
                @endif
              @else
                <!-- <li class="dropdown-submenu"> -->
                  @if ($valuec->rDe)
                  <h3>

                 <b> <a href="#">{!! $valuec->rDe->name !!}</a> </b>
                  </h3>
                  @endif
                  <!-- <ul class="dropdown-menu"> -->
                    @foreach ($menu as $valuec2)
                      @if($valuec2->parent == $valuec->id)
                        @if($valuec2->url)
                          @if ($valuec2->rDe)
                            <li><a href="{!! url((string)$valuec2->url) !!}">{!! $valuec2->rDe->name !!}</a></li>
                          @endif
                         @else
                              <li class="dropdown-submenu">
                                  @if ($valuec2->rDe)
                                  <b> <a href="#">{!! $valuec2->rDe->name !!}</a></b>
                                  @endif
                                  <ul class="dropdown-menu">
                                    @foreach($menu as $valuec3)
                               
                                     @if($valuec3->parent == $valuec2->id)
                                      @if ($valuec3->rDe)
                                       <li><a href="{!! url((string)$valuec3->url) !!}" target="_blank">{!! $valuec3->rDe->name !!}</a></li>
                                      @endif
                                     @endif
                               
                                    @endforeach
                                 </ul>
                              </li>
                        @endif
                      @endif
                    @endforeach
                  <!-- </ul>
                </li> -->
              @endif
              </ul>
            @endif
          @endforeach
          </div>
          </div>
          </ul>
      </li>
      @elseif($setting['layout_menu'] == 1)
        <li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle">{!! $value->rDe->name !!} <div class="arrow-up"></div></a>
          <ul class="dropdown-menu" role="menu">
          @foreach ($menu as $valuec)
            @if($valuec->parent == $value->id)
              @if($valuec->url)
                <li><a href="{!! url((string)$valuec->url) !!}">{!! $valuec->rDe->name !!}</a></li>
              @else
                <li class="dropdown-submenu">
                <b>  <a href="#">{!! $valuec->name !!}</a> </b>
                  <ul class="dropdown-menu">
                    @foreach ($menu as $valuec2)
                      @if($valuec2->parent == $valuec->id)

                      @if($valuec2->url)
                        <li><a href="{!! url((string)$valuec2->url) !!}">{!! $valuec2->rDe->name !!}</a></li>
                      
                                @else
                                <li class="dropdown-submenu">
                                 
                                  <b> <a href="#">{!! $valuec2->rDe->name !!}</a></b>
                                  <ul class="dropdown-menu">
                                @foreach($menu as $valuec3)
                               
                                @if($valuec3->parent == $valuec2->id)
                               
                                <li><a href="{!! url((string)$valuec3->url) !!}" target="_blank">{!! $valuec3->rDe->name !!}</a></li>
                                 
                                @endif
                               
                                @endforeach
                                </ul>
                                </li>
                          @endif
                        @endif
                    @endforeach
                  </ul>
                </li>
              @endif
            @endif
          @endforeach
          </ul>
        </li>
      @endif
    @endif
  @endif
@endforeach
<li class="dropdown yamm-fw"><a href="#" data-toggle="dropdown" class="dropdown-toggle"><i class="fa fa-search search-btn"></i> <div class="arrow-up"></div></a>
  <ul class="dropdown-menu" style="text-transform: capitalize;">
    <form action="#">
      <div class="input-group input-large col-sm-12">
        <script>
          (function() {
            var cx = '{{$setting['id_gsc']}}';
            var gcse = document.createElement('script');
            gcse.type = 'text/javascript';
            gcse.async = true;
            gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
            '//cse.google.com/cse.js?cx=' + cx;
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(gcse, s);
          })();
        </script>
        <gcse:search></gcse:search>
      </div>
    </form>
  </ul>
</li>