Table actions returning the wrong records
I'm making a table for users to see the messages they're allowed to check. It only has a view action. The project uses livewire components instead of filament panels. I already have multiple tables with custom queries, but this one is the first to cause this issue.
The query is getting the records respecting the conditions as it should. So at first glance, the table seems fine, but no matter which action I try (view, edit, delete) of any record, the action always gets the same record.
If I remove the query conditions to recover all the records or only keep one condition, the actions recover the right records. Depending on which conditions I keep, there are some cases where the first two of the table will be fine, but the rest will get one of the first two.
The issue is before getting the infolist, I'm having the same reaction if I dd the record instead of the infolist or a form.
Has anyone encountered something similar?
6 Replies
probably an issue with your query. Try inspecting the view button in devtools and verify the
id
parameter in the mountTableAction
all buttons have their record respective id in
mountTableAction
but still fetch the same record
here's the buttons, the id at the end is matching the record for each button. When clicked, it's always returning the same record in the table, example the record with id of two even if the mountTableAction
as an other id in parameter
Hello I have the same issues and it was for modifying the query in the table, I resolve it using a scope into the model
Thanks! I'm not sure why it's not working in the table, but the scope is working! 😄
no problem!