You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use ->meta() to include something related to players:
$teams = $teamsService->getTeams();
return responder()
->success($teams->paginate())
->meta($teamsService->getPlayerMeta($teams))
->respond(200);
function getPlayerMeta($teams) {
dd($teams); // this only have the array of teams without the ?with=players relation
}
The questions is, is it somehow possible to access the relations that are going to be loaded and use those in ->meta() ?
The text was updated successfully, but these errors were encountered:
I'm afraid there's currently no way to do this as the relations are kind of hard coded into the last step of the response creation. Luckily this will be possible in the new version though, as all relations will have to be loaded before sending them to the responder.
Hi,
The title of the issue is superbad, but i try to explain it better here:
I have a http request, lets say
GET /teams?with=players
and later on my controller I have:
I would like to use
->meta()
to include something related to players:The questions is, is it somehow possible to access the relations that are going to be loaded and use those in ->meta() ?
The text was updated successfully, but these errors were encountered: