Så efter at have søgt og læst meget mere fra forskellige kilder, er dette, hvad jeg fandt på, og det fungerer fint:
/app/models/Navigation.php
<?php
class Navigation extends Eloquent {
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'navigation';
public function parent() {
return $this->hasOne('navigation', 'id', 'parent_id');
}
public function children() {
return $this->hasMany('navigation', 'parent_id', 'id');
}
public static function tree() {
return static::with(implode('.', array_fill(0, 4, 'children')))->where('parent_id', '=', NULL)->get();
}
}
/app/controllers/HomeController.php
<?php
class HomeController extends BaseController {
protected $layout = "layouts.main";
public function showWelcome()
{
$items = Navigation::tree();
$this->layout->content = View::make('layouts.home.index')->withItems($items);
}
}
/app/views/layouts/home/index.blade.php
<ul>
@foreach($items as $item)
<li>{{ $item->title }}
@foreach($item['children'] as $child)
<li>{{ $child->title }}</li>
@endforeach
</li>
@endforeach
</ul>