F
Filament13mo ago
btx

Custom Action in Table

I am trying to create a custom Action, however I am unable to retrieve the record that I clicked on. What am I doing wrong? File: FormSubmissionResource::table()
->actions([
Tables\Actions\Action::make('import')
->label('Import')
->icon('heroicon-o-cloud-upload')
->action(function ($data) {
dd($data); // => []
})
->actions([
Tables\Actions\Action::make('import')
->label('Import')
->icon('heroicon-o-cloud-upload')
->action(function ($data) {
dd($data); // => []
})
2 Replies
LeandroFerreira
LeandroFerreira13mo ago
->action(function (YourModel $record) {
})
->action(function (YourModel $record) {
})
https://filamentphp.com/docs/2.x/tables/actions#single-actions
Filament
Actions - Table Builder - Filament
The elegant TALL stack table builder for Laravel artisans.
btx
btx13mo ago
ok I had to define the type, thx