Laravel 4 hasMany with WHERE clause
public function menuItems(){
return $this->hasMany('MenuItem');
}
Called with
$menu_items = $menu->menuItems()->where('parent', 0)->get();
public function menuItems(){
return $this->hasMany('MenuItem');
}
Called with
$menu_items = $menu->menuItems()->where('parent', 0)->get();