<div class="ui left inline vertical sidebar push visible">
    <div class="ui inverted vertical following fluid accordion menu">
        <a href="<?php echo e(url('/admin/index')); ?>" class="item">
            <h5 class="ui inverted header">
                <div class="content">
                    後台管理系統
                </div>
            </h5>
        </a>
    <?php foreach($navs as $v): ?>
        <?php if( count($v->child()) ): ?>
        <div class="item">
            <a href="#" class="title <?php echo e(in_array(Request::segment(1), $v->childary())?'active':''); ?>">
                <i class="dropdown icon"></i>
                <b><?php echo e($v->name); ?></b>
            </a>
            <div class="content <?php echo e(in_array(Request::segment(1), $v->childary())?'active':''); ?>">   
                <?php foreach($v->child() as $c): ?>
                <?php if( Auth::user()->id==1 || ( Auth::user()->id>1 && in_array($c->slug, Session::get('permission')) ) ): ?>
                <a href="<?php echo e(url($c->slug)); ?>" class="item <?php if($c->slug==Request::segment(1)): ?> active <?php endif; ?>"><?php echo e($c->name); ?>

                    <?php if($c->count > 0): ?>
                    <div class="ui red label"><?php echo e($c->count); ?></div>
                    <?php endif; ?>
                </a>
                <?php endif; ?>
                <?php if($c->divider): ?>
                <div class="divider"></div>
                <?php endif; ?>
                <?php endforeach; ?>
            </div>
        </div>
        <?php else: ?>
        <a href="<?php echo e(url($v->slug)); ?>" class="item <?php if($v->slug==Request::segment(1)): ?> active <?php endif; ?>">
            <?php echo e($v->name); ?>

        </a>
        <?php endif; ?>
    <?php endforeach; ?>
    </div>
</div>