/** * @param $id * @param bool $withRoles * @return mixed * @throws Exception */ public function findOrThrowException($id, $withRoles = false) { if ($withRoles) { $user = $this->model->with('roles')->withTrashed()->find($id); } else { $user = $this->model->withTrashed()->find($id); } if (!is_null($user)) { return $user; } throw new Exception('That user does not exist.'); }
/** * * @param model $model * @return model */ public function get($model) { return $this->convertFormat($model->with('questions_attachment')->with('user')->get()); }
/** * Helper make * * @param array $with * @return mixed|void */ public function make(array $with) { return $this->model->with($with); }