title: Laravel factory error "Maximum retries of 10000 reached without finding a unique value" when I use unique Faker method
body: <p>I have a Unit Seeder with this code in the run method:
  <code>Unit::factory()-&gt;count(10)-&gt;create();</code></p>
  <p>And the Unit Factory looks like this:</p>
  <pre><code>class UnitFactory extends Factory
  {
      protected $model = Unit::class;
  
      public function definition()
      {
          // $unitUbitactionIds = UnitUbication::pluck('id');
          $testIds = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
          
          return [
              'unit_ubication_id' =&gt; $this-&gt;faker-&gt;unique()-&gt;randomElement($testIds),
              'name' =&gt; $this-&gt;faker-&gt;word()
          ];
      }
  }
  </code></pre>
  <p>This thrown an OverflowException: &quot;Maximum retries of 10000 reached without finding a unique value&quot;.</p>
  <p>If there are 10 Units, and 10 items in the array... Why can't I get one unique id from the array for each Unit?</p>