*/ public function handle(FilterScope $filter, int $perPage): LengthAwarePaginator { return Member::search($filter->search)->query( fn ($q) => $q->select('*') ->withFilter($filter) ->ordered() )->paginate($perPage); } public function asController(ActionRequest $request): AnonymousResourceCollection { return MemberResource::collection($this->handle(FilterScope::fromRequest($request->input('filter', '')), $request->input('per_page', 15))); } }