filament table, get current selected row data in action button form

 Tables\Actions\Action::make('test')
                        ->label('test')
                        ->form(function ($record) {
                            return [
                                Forms\Components\Select::make('quote_status')
                                ->options([
                                    'draft' => 'Draft',
                                    'new' => 'New',
                                    'process' => 'Process',
                                    'done' => 'Done',
                                    'expired' => 'Expired',
                                    'cancelled' => 'Cancelled',

                                ])
                                ->default($record->quote_status)
                                ->searchable()
                                ->preload()
                                ->required(),
                            ];
                        })
                        ->action(function ($record, array $data): void {
                            $record->update($data);

                            // Handle update success (optional)
                            Notification::make()
                            ->title('Successfully update')
                            ->success()
                            ->send();
                        }),
                  

Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *