PHP has run out of memory while performing Eloquent operations. The biggest cause of this is the query logging that Laravel does behind the scenes. You can either increase memory_limit to a higher amount, however a better solution is to add this line before you start your database queries: