I have a query where I want to get a subset of all comments in a discussion channel.
$channel->comments ->where('type', 3);
But I am running into a memory exhausted error. When I swap out this query for:
Comment::where('channel_id', $channel->id) ->where('type', 3) ->get();
This works without exhausting the memory. What is the reason for this? And where can I read up more about the inner workings of eloquent?
Thanks in advance!