*/ public function handle(Form $form, ParticipantFilterScope $filter): LengthAwarePaginator { return $form->participants()->withFilter($filter)->with('form')->paginate(15); } public function asController(Form $form): AnonymousResourceCollection { $filter = ParticipantFilterScope::fromRequest(request()->input('filter')); return ParticipantResource::collection($this->handle($form, $filter)) ->additional(['meta' => ParticipantResource::meta($form)]); } }