© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
26 replies
Sayy

how to custom actions on create record

how custom actions if the actions on create record, because im confuse after click the button actions then can generate pdf or something update data from im input on view create ?

 protected function getFormActions(): array
    {
        return [
            Actions\CreateAction::make()->label('Simpan & Cetak')
                ->color('warning')
                ->using(function (array $data): Model {
                    return static::getModel()::create($data);
                })->action(function (Order $record) {
                    $pdf = Pdf::loadView('pdf.print-order', [
                        'order' => $record,
                    ]);

                    return response()->streamDownload(function () use ($pdf) {
                        echo $pdf->stream();
                    }, 'receipt-' . $record->order_number . '.pdf');
                })->submit('form')
                ->button(),
            ...parent::getFormActions(),
        ];
    }
 protected function getFormActions(): array
    {
        return [
            Actions\CreateAction::make()->label('Simpan & Cetak')
                ->color('warning')
                ->using(function (array $data): Model {
                    return static::getModel()::create($data);
                })->action(function (Order $record) {
                    $pdf = Pdf::loadView('pdf.print-order', [
                        'order' => $record,
                    ]);

                    return response()->streamDownload(function () use ($pdf) {
                        echo $pdf->stream();
                    }, 'receipt-' . $record->order_number . '.pdf');
                })->submit('form')
                ->button(),
            ...parent::getFormActions(),
        ];
    }
image.png
Solution
probably your repeater has a relationship.. if you want to access the repeater data in
$data
$data
, you need to add
->dehydrated()
->dehydrated()
in the repeater
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

how to custom actions on editing record
FilamentFFilament / ❓┊help
17mo ago
How to create a dynamic table actions based on record ?
FilamentFFilament / ❓┊help
3y ago
How to create custom actions and show them in custom views?
FilamentFFilament / ❓┊help
3y ago
Custom record pass to recordActions of resource page
FilamentFFilament / ❓┊help
4mo ago