@php
$sub = function ($menu,$sub_level,$id_parent){
$sub_menu = DB::table('menu')->where('menu_parent',$menu)->get();
if(!empty($sub_menu))
{
$sub_level++;
foreach ($sub_menu as $value)
{
$sparator='';
for($z=0;$z<$sub_level;$z++)
{
$sparator .='---';
}
echo '
';
}
}
};
$compare='';
if($menu->menu_parent == 0)
{
$compare = $menu->menu_id;
}
else
{
$compare = $menu->menu_parent;
}
@endphp