What @bashy is trying to say it's this:
Schema::create('menu', function(Blueprint $table)
{
$table->increments('id');
$table->string('text');
/*some cool features */
$table->integer('order');
$table->boolean('is_visible');
$table->integer('badge');
/*some cool features */
$table->integer('parent_id')->unsigned()->nullable()->default(null);
$table->foreign('parent_id')->references('id')->on('menu');
});)
A menu table has a references to itself. It means a menu can be submenu(has a parent menu) of another menu.
That's probably the best option.
Now you can select all menus and order by parent_id and order field. The first menu will have parent_id null.
The easiest way to generate the menu list will be a recursive function. Recursion is kinda complicated thing when you're starting but easy when you get the idea.
the recursion idea is something like this:
it's a Pseudocode (not a real one...)
function print_menu($node)
{
for($i =0; $i<$node->children->size(); ++$i)
{
echo "<li>".$node->children[$i]."</li>";
if($node->children[$i]->children > 0)
{
echo "<ul>";
print_menu($node->children[$i]);
echo "</ul>";
}
}
}
echo "<ul>";
print_menu($root);
echo "</ul>";