Open Hesesses opened 6 years ago
Hey! It’s currently not possible to rename relationships. However, you can create an includeUsers
method that returns $team->activeUsers
, however, I’m not sure how that would work with two relations referencing the same name. What should happen if you call teams?with=users,activeUsers
?
Sorry, I havent replied this earlier. If I remember correctly we ended up with the solution you suggested, so with=users,activeUsers works fine
Is it possible to load relation as 'something'
For example I have these relations
I'm sending get request to /teams?with=users or /teams?with=activeUsers and would like to have response from both requests as teams[].users[].