Skip to content
Advertisement

Tag: eloquent

Laravel – seeding large SQL file

A memory exhaustion happens when I run my DB seed script in production. Below is my seed script. So what I did was add a no-limit on my seed script. The problem now is that when I run the script it logs the output into the terminal the content of the SQL script (which is very, very big). Is there

Counting related rows in a child table

I have been trying to do some queries and getting a count on related tables using eloquent. Tables: requests contact (belongs to requests) history (belongs to contact) As such X number of requests each have Y number of contacts which in term each have Z number of histories Using sql I can do something like this to get all the

Advertisement