4 months ago

Memory exhausted when $channel->comments but not for Comment::where('channel_id), $channel->id)->get()

Posted 4 months ago by slipperydippery

I have a query where I want to get a subset of all comments in a discussion channel.

	->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)

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!

Please sign in or create an account to participate in this conversation.