the table action button does not retrieve the correct record
Hello everyone, I have a problem with my code. when I click on payment method action, the correct record is not always retrieved. that's only my probably. Here is my code:
//Action de paiement
12 Replies
Hi,
I'm having the same problem.
The table action always get the first row of the table
what code are you using?
@Leandro Ferreira
Simple code ...
Tables\Actions\Action::make('refund')
->action(function (Model $sale) {
dd($sale->id);
})
Always get first record orf the table
try
YourModel $record
@Leandro Ferreira
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)..
@Leandro Ferreira
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')
share the whole code you are using..