@foreach ($menu as $value)
  @if(!$value->parent)
    @if($value->url)
      <li><a href="{!! url((string)$value->url) !!}">@if ($value->rSa) {!! $value->rSa->name !!} @endif</a></li>
    @else
      <li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle">@if ($value->rSa) {!! $value->rSa->name !!} @endif<div class="arrow-up"></div></a>
          <ul class="dropdown-menu" role="menu">
          @foreach ($menu as $valuec)
            @if($valuec->parent == $value->id)
              @if($valuec->url)
                @if ($valuec->rSa)
                <li><a href="{!! url((string)$valuec->url) !!}">@if ($valuec->rSa) {!! $valuec->rSa->name !!}@endif</a></li>
                @endif
              @else
                <li class="dropdown-submenu">
                  @if ($valuec->rSa)
                  <a href="#">{!! $valuec->rSa->name !!}</a>
                  @endif
                  <ul class="dropdown-menu">
                    @foreach ($menu as $valuec2)
                      @if($valuec2->parent == $valuec->id)
                        @if ($valuec2->rSa)
                        <li><a href="{!! url((string)$valuec2->url) !!}">@if ($valuec2->rSa) {!! $valuec2->rSa->name !!} @endif</a></li>
                        @endif
                      @endif
                    @endforeach
                  </ul>
                </li>
              @endif
            @endif
          @endforeach
          </ul>
      </li>
    @endif
  @endif
@endforeach
