title: Why am I getting an error that rand is not recognized when seeding in laravel
body: <p>I am trying to run php artisan:migrate --seed for my DatabaseSeeder.php but I keep getting this error in my terminal:</p>
  
  <p>InvalidArgumentException  : Unknown formatter "rand"</p>
  
  <pre><code>239|                 return $this-&gt;formatters[$formatter];
  240|             }
  241|         }
  </code></pre>
  
  <blockquote>
    <p>242|         throw new \InvalidArgumentException(sprintf('Unknown formatter "%s"', $formatter));
        243|     }
        244|
        245|     /**
        246|      * Replaces tokens ('{{ tokenName }}') with the result from the token method call</p>
  </blockquote>
  
  <p>Here is the code from my Database Seeder php</p>
  
  <pre><code>    &lt;?php
  use App\Question;
  use Illuminate\Database\Seeder;
  
  class DatabaseSeeder extends Seeder
  {
      /**
       * Seed the application's database.
       *
       * @return void
       */
      public function run()
      {
          // $this-&gt;call(UsersTableSeeder::class);
          factory(App\User::class, 3)-&gt;create()-&gt;each(function($u){
              $u-&gt;questions()
                -&gt;saveMany(
                    factory(App\Question::class, rand(1,5))-&gt;make()
              );
          });
      }
  }
  </code></pre>
  
  <p>Why am I getting this error?</p>