Bulk operation on a few table rows, performing multi-update of a column value in a modal form.
We add a new Bulk Action where adding a form()
method opens a modal with a form.
In the form, we select data.
The action accepts a collection of selected records and an array of data from the form as parameters.
For each record, we update the corresponding data and deselect records.
Here is what the action itself looks like:
Tables\Actions\BulkAction::make('Change author') ->icon('heroicon-m-pencil-square') ->form([ Forms\Components\Select::make('author_id') // ...