gender_id === 1) { $this->father_id = $father->id; $this->save(); return $father; } return false; } public function setMother(User $mother) { if ($mother->gender_id === 2) { $this->mother_id = $mother->id; $this->save(); return $mother; } return false; } }