Have you ever faced “Out of memory” issue when running some large queries in Laravel?
exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Out of memory (allocated xxxx) (tried to allocate xxxxxxx bytes)' in
By default, laravel will keep log all queries in memory, and at some points it can cause your app to use excess memory.
Try adding lines below in your controller to solve this issue.
It will disable query log in laravel. If you still get the error, try to raise memory limit in your php configuration file.
If it still exists, you have to start reviewing your database queries.