repository = $repository; } public function execute(int $type, int $referenceId){ $contacts = $this->repository->where('type', $type) ->where('reference_id', $referenceId)->orderBy('created_at')->paginate(5); // Return collection of contacts as a resource return ContactResource::collection($contacts); } }