*/ public function handle(InvoiceFilterScope $filter): Builder { return $filter->getQuery()->query(fn ($q) => $q->with('positions')); } public function asController(ActionRequest $request): Response { session()->put('menu', 'invoice'); session()->put('title', 'Rechnungen'); $filter = InvoiceFilterScope::fromRequest($request->input('filter', '')); return Inertia::render('invoice/Index', [ 'data' => InvoiceResource::collection($this->handle($filter)->paginate(15)), ]); } }