public function update(Child $child, $attributes) { $child->update($attributes); $this->syncParents($child, $attributes); return $child; }