repository = $repository; } /** * @return Builder */ public function getRepository(): Builder { return $this->repository->newQuery(); } /** * @param Builder $query * @return Collection * @throws ResourceNotFoundException */ public function getResults(Builder $query, array $param = []):Collection { if (!$query->exists()) { throw new ResourceNotFoundException('Unable to find any record based on the criteria provided'); } return $query->get(); } }