where('type', $type); } public function parent($parent) { return $this->where('parent_id', $parent); } }