title: How to seed database migrations for laravel tests?
body: <p>Laravel's <a href="https://laravel.com/docs/5.4/database-testing#resetting-the-database-after-each-test" rel="noreferrer">documentation</a> recommends using the <code>DatabaseMigrations</code> trait for migrating and rolling back the database between tests.</p>
  
  <pre><code>use Illuminate\Foundation\Testing\DatabaseMigrations;
  
  class ExampleTest extends TestCase
  {
      use DatabaseMigrations;
  
      /**
       * A basic functional test example.
       *
       * @return void
       */
      public function testBasicExample()
      {
          $response = $this-&gt;get('/');
  
          // ...
      }
  }
  </code></pre>
  
  <p>However, I've got some seed data that I would like to use with my tests. If I run:</p>
  
  <pre><code>php artisan migrate --seed
  </code></pre>
  
  <p>then it works for the first test, but it fails subsequent tests. This is because the trait rolls back the migration, and when it runs the migration again, it doesn't seed the database. How can I run the database seeds with the migration?</p>