Relationship manager - Issues when using a union relation
I am building an application for tracking chess games.
I want to be able to look at a player and see all games they have played. However I need a union query as I do not know whether a Player was Player 1 or Player 2.
I have a model of Game which has the following properties:
Then I have a Player Model with the relation function of:
In tinker I am able to return all games that belong to a user.
I have created a relationship manager for the Player Resource but I get an error. By the looks of it Filament is adding an order by games.id.
I am not too sure how to proceed further to prevent this error. Can I tell filament not to have an order by?
1 Reply
Commenting to keep this active
Bump
Bumping up
I think I have found a solution but not sure if it is a good one.
If anyone (especially filament team) could say whether it is the best solution please let me know.
Within my relationship manager I have had to override this function:
This means that I cannot have sortable on any of my columns.
I assume there is a better way which would be to override the applySortingToTableQuery so the order gets applied correctly