Level 67
@cosminc You can do this either as meta or top level meta as you're mentioning. Just use whichever you prefer organizationally.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I have an API resource that returns all the users along with a count for posts, comments and ratings for each user.
I want to also include a summary in the returned array and I'm wondering which would be the best approach to do this.
I was thinking about using with() like the documentation states:
public function with($request)
{
return [
'meta' => [
'summary' => '...'
],
];
}
What do you think?
Please or to participate in this conversation.