/** * * @param integer $id * @param boolean $withRoles * @return object * @throws GeneralException */ public function findOrThrowException($id, $withRelations = false) { if ($withRelations) { $participant = Participant::with('role')->with('pcode')->withTrashed()->find($id); } else { $participant = Participant::withTrashed()->find($id); } if (!is_null($participant)) { return $participant; } throw new GeneralException('That participant does not exist.'); }