public function index(){
$menue=$menu=DB::table('admin_menu')->orderby('px','asc')->get();
return view('admin.index',['menu'=>$menu,'menue'=>$menue]);
}
view
@foreach($menu as $v)
@if($v->fid==0)
@if($v->mid==1)
<li class="active">
@else
<li class="">
@endif
<a href="{{$v->url }}">{!!$v->tubiao!!}<span class="nav-label">{{$v->menu_name}}</span> <span class="fa arrow"></span>{!! $v->youfubiao!!}</a>
<ul class="nav nav-second-level collapse">
@foreach($menue as $c)
{{--2 {{print_r($v->mid)}}--}}
@if($c->fid==$v->mid)
<li class=""><a href="">{!! $c->menu_name !!}{!! $c->youfubiao !!}</a></li>
@endif
@endforeach
</ul>
</li>
@endif
@endforeach
排序 二级菜单一步搞定