$this->service->paginated(...$request->validatedWithDefaults()), ]); } public function create(): Response { return Inertia::render('admin/manage/invoice/create', [ 'statusOptions' => InvoiceStatus::toSelect(), ]); } public function store(InvoiceRequest $request): RedirectResponse { return $this->handleAction( fn () => $this->service->store($request->validated()), 'Invoice berhasil ditambahkan.', 'admin.manage.invoices.index', 'admin.manage.invoices.create' ); } public function edit(Invoice $invoice): Response { return Inertia::render('admin/manage/invoice/edit', [ 'invoice' => $this->service->getForEdit($invoice), 'statusOptions' => InvoiceStatus::toSelect(), ]); } public function print(Invoice $invoice): Response { return Inertia::render('admin/manage/invoice/print', [ 'invoice' => $this->service->getForPrint($invoice), ]); } public function share(Invoice $invoice): Response { return Inertia::render('admin/manage/invoice/print', [ 'invoice' => $this->service->getForPrint($invoice), ]); } public function update(InvoiceRequest $request, Invoice $invoice): RedirectResponse { return $this->handleAction( fn () => $this->service->update($invoice, $request->validated()), 'Invoice berhasil diperbarui.', 'admin.manage.invoices.index', 'admin.manage.invoices.edit', ['invoice' => $invoice] ); } public function destroy(Invoice $invoice): RedirectResponse { return $this->handleAction( fn () => $this->service->destroy($invoice), 'Invoice berhasil dihapus.', 'admin.manage.invoices.index' ); } }