<?php
/**
 * Created by PhpStorm.
 * User: jirislav
 * Date: 6.5.17
 * Time: 17:54
 */
?>
@foreach($items as $item)

    @if(!$parent || $item->hasChildren())
        <li @lm-attrs($item) @if($item->hasChildren()) class="dropdown" @endif @lm-endattrs >
            @if($item->link)
                <a @lm-attrs($item->link) @if($item->hasChildren()) class="dropdown-toggle" data-toggle="dropdown"
                   @endif @lm-endattrs href="{!! $item->url() !!}">
                    @lang($item->title)
                    @if($item->hasChildren()) <b class="caret"></b>
                    @endif
                </a>
            @else
                @lang($item->title)
            @endif
            @if($item->hasChildren())
                <ul class="dropdown-menu">
                    @include('layouts.menu', array('items' => $item->children(), 'parent' => false))
                </ul>
            @endif
        </li>
    @endif
    @if($item->divider)
        <li{!! Lavary\Menu\Builder::attributes($item->divider) !!}></li>
    @endif
@endforeach