title: Laravel fill database table column from array using factory
body: <p>I have a database table look like this</p>
  
  <pre><code>|id |col2|col3|col4|
  -------------------
  | 1 |elm0|....|....|
  | 2 |elm1|....|....|
  | 3 |elm2|....|....|
  |...|....|....|....|
  |N+1|elmN|....|....|
  </code></pre>
  
  <p>I want to fill the <code>col2</code> with data from array (not in random way).
  Example array:</p>
  
  <pre><code>$dataArray = array(elm0, elm1, elm2,...)
  </code></pre>
  
  <p>I created this factory: </p>
  
  <pre><code>&lt;?php
  
  use Faker\Generator as Faker;
  
  $factory-&gt;define(App\Unit::class, function (Faker $faker) {
  
      $dataArray = array(elm0, elm1, elm2,...,elmN);
  
      return [
          'col2' =&gt; $dataArray[$index];
          'col3' =&gt; $faker-&gt;'whatever';
          'col4' =&gt; $faker-&gt;'whatever';
      ];
  
  });
  </code></pre>
  
  <p>How I can do this?</p>