Infolist is the same for all the records.
I'm trying to list courses in sections (instead of a table). But for every course it returns the same data (data of the last course) in the infolist. The header and the description of the course are displayed correctly.
Solution:Jump to solution
Seems like I fixed it by adding
->state(fn ($record) => $record->the_attribute_name))to all the components in the infolist.4 Replies
I have the same problem
Solution
Seems like I fixed it by adding
->state(fn ($record) => $record->the_attribute_name))to all the components in the infolist.When I try to dump the selected record inside a table action using dd($record), it always returns the first record of the table — no matter which record I actually click on.
Doesn't look like a bug. You need to set the state somehow
You could probably also just use
->state($record->toArray()) on the Section