F
Filament2y ago
shad

loop in table builder

how can do a loop inside the filament table, I have a user who has a collection of games and I want to loop through them and show the result in the table
6 Replies
awcodes
awcodes2y ago
Are the games a relationship
shad
shadOP2y ago
Users has relationship with game users and game users has relationship with games And i want to show the games I have to loop through game users to access game relationship
awcodes
awcodes2y ago
If the relationships are set up correctly you should be able to do ::make(‘gameUsers.games’) Assuming this is a users resource. Kinda doing some guessing here since I can’t see everything.
shad
shadOP2y ago
Game users belong to games relationship I can only get an attribute pf game users table
awcodes
awcodes2y ago
Sounds like you might need a HasManyThrough relationship. but i guess you can perform another query to get all the games that have the record's game user id. then implode them to a comma separated list. that won't be very performant.
shad
shadOP2y ago
yes that's what i did

Did you find this page helpful?