I cannot get the data in the current table with Action

I am trying to get the data available with the collection below and try to process it, but the data content is empty.
Tables\Actions\Action::make('is_confirmed')->label('Onayla')->icon('heroicon-s-pencil')
->action(function (Collection $records, array $data): void {
dd($records);
$records->each(function ($record) {
dd($record);
$record->update(['is_confirmed' => true]);
});
})
->requiresConfirmation()
Tables\Actions\Action::make('is_confirmed')->label('Onayla')->icon('heroicon-s-pencil')
->action(function (Collection $records, array $data): void {
dd($records);
$records->each(function ($record) {
dd($record);
$record->update(['is_confirmed' => true]);
});
})
->requiresConfirmation()
No description
1 Reply
Lara Zeus
Lara Zeus14mo ago
the Collection $records is for bulk action, your action is for a row action try ModelName $record
Want results from more Discord servers?
Add your server