Closed
Description
Laravel provides support to add counts of relations to a model. e.g.
$posts = App\Post::withCount('comments')->get();
foreach ($posts as $post) {
echo $post->comments_count;
}
Is there a way to incorporate $model->withCount(...)
into a laravel-json-api request?