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
Are the games a relationship
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
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.
Game users belong to games relationship
I can only get an attribute pf game users table
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.
yes that's what i did