F
Filament16mo 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
awcodes16mo ago
Are the games a relationship
shad
shadOP16mo 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
awcodes16mo 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
shadOP16mo ago
Game users belong to games relationship I can only get an attribute pf game users table
awcodes
awcodes16mo 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
shadOP16mo ago
yes that's what i did
Want results from more Discord servers?
Add your server