*/ public function handle(string $filter): LengthAwarePaginator { return FormFilterScope::fromRequest($filter)->getQuery()->query(fn ($query) => $query->withCount('participants'))->paginate(15); } public function asController(ActionRequest $request): Response { session()->put('menu', 'form'); session()->put('title', 'Veranstaltungen'); return Inertia::render('form/Index', [ 'data' => FormResource::collection($this->handle($request->input('filter', ''))), ]); } }