title: Laravel - seeding large SQL file
body: <p>A memory exhaustion happens when I run my DB seed script in production.</p>
  
  <p>Below is my seed script.</p>
  
  <pre><code>class MembershipTableSeeder extends Seeder 
  {
      public function run()
      {
          DB::table('members')-&gt;delete();
  
          foreach (range(1, 99) as $days){
              Members::create(array('membership_code' =&gt; 'test'.$days));
          }
  
          DB::unprepared(file_get_contents(app_path()."/database/seeds/members.sql"));
      }
  }
  </code></pre>
  
  <p>So what I did was add a no-limit on my seed script. </p>
  
  <pre><code>ini_set('memory_limit', '-1');
  </code></pre>
  
  <p>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).</p>
  
  <p>Is there a good way of running a SQL dump inside my DB seeds that doesn't consume much memory?  What I did now was run it manually:</p>
  
  <pre><code>mysql -uuser -p db &lt; script.sql
  </code></pre>