F
Filament2mo ago
Sayy

how to custom actions on editing record

how custom actions if the actions on editing record, because after click custom action not update, and i want to generate pdf after that
Action::make('customAction')
->label('SIMPAN & CETAK')
->button()
->color('primary')
->action(function () {
$data = $this->form->getState();

$this->getSaveFormAction();

$dataOrder = Order::where('order_number', $data["order_number"])->with('customer', 'orderDetails')->get();
//dd($dataOrder);
$pdf = Pdf::loadView('pdf.print-order-create', [
'order' => $dataOrder,
]);

return response()->streamDownload(function () use ($pdf) {
echo $pdf->stream();
}, 'Faktur Pembayaran - ' . $data["order_number"] . '.pdf');
}),
Action::make('customAction')
->label('SIMPAN & CETAK')
->button()
->color('primary')
->action(function () {
$data = $this->form->getState();

$this->getSaveFormAction();

$dataOrder = Order::where('order_number', $data["order_number"])->with('customer', 'orderDetails')->get();
//dd($dataOrder);
$pdf = Pdf::loadView('pdf.print-order-create', [
'order' => $dataOrder,
]);

return response()->streamDownload(function () use ($pdf) {
echo $pdf->stream();
}, 'Faktur Pembayaran - ' . $data["order_number"] . '.pdf');
}),
already using getsaveformaction but not update
1 Reply
Sayy
SayyOP2mo ago
any idea ? or solution
Want results from more Discord servers?
Add your server