#the table action button does not retrieve the correct record
13 messages · Page 1 of 1 (latest)
Hi,
I'm having the same problem.
The table action always get the first row of the table
what code are you using?
@cyan forum
Simple code ...
Tables\Actions\Action::make('refund')
->action(function (Model $sale) {
dd($sale->id);
})
Always get first record orf the table
try YourModel $record
@cyan forum
Tables\Actions\Action::make('refund')
->action(function (Sale $sale) {
dd($sale->id);
})
Same problem. Always get first row sale->id
😦
I mean ->action(function (Sale $record) { dd($record->id)..
@cyan forum
Everything was working perfectly until yesterday.
But this code working very well
->url(fn (Model $record): string => '/sales/' . $record->id . '/refund')
?
Not working
Everything was working perfectly until yesterday.
Something that you have changed 🤷♂️
and this should work, probably something wrong in your code..
Simple resource ....
Deleted and recreated, but error still exists.
Not working (get always first row of table)
->action(function (Sale $record) { dd($record->id)}
Working fine
->url(fn (Sale $record): string => '/sales/' . $record->id . '/refund')