public function setAnswer($answer) { if (!is_null($answer)) { $user = Auth::user(); $reply = Reply::firstOrNew(['user_id' => $user->id, 'question_id' => $this->id]); $reply->reply = $answer; return $reply->save(); } }