title: Laravel 5.1 - Model Factory Error seed
body: <p>Hi i'm trying to populate my database with some Articles, BlogCategories, Users.</p>
  
  <p>when i do "php artisan db:seed" i have this error: </p>
  
  <blockquote>
    <p>[ErrorException] Argument 2 passed to
    Illuminate\Database\Eloquent\Factory::define() must be callable.
    string given, called in
    C:\xampp\htdocs\2016\database\factories\ModelFactory.php on line 22
    and defined</p>
  </blockquote>
  
  <p>I inserted all relations in my models and i done my migrations good! </p>
  
  <p>ModelFactory.php</p>
  
  <pre><code>$factory-&gt;define(dixard\User::class, 'admin', function (Faker\Generator $faker) {
      return [
          'name' =&gt; $faker-&gt;name,
          'email' =&gt; $faker-&gt;safeEmail,
          'password' =&gt; bcrypt('123'),
          'user_type' =&gt; 3,
          'remember_token' =&gt; str_random(10),
      ];
  }); // line 22 
  
  $factory-&gt;define(dixard\User::class, 'member', function (Faker\Generator $faker) {
      return [
          'name' =&gt; $faker-&gt;name,
          'email' =&gt; $faker-&gt;safeEmail,
          'password' =&gt; bcrypt('123'),
          'user_type' =&gt; 1,
          'remember_token' =&gt; str_random(10),
      ];
  });
  
  $factory-&gt;define(dixard\BlogCategory::class, function (Faker\Generator $faker) {
      return [
          'name' =&gt; $faker-&gt;word,
      ];
  });
  
  $factory-&gt;define(dixard\Article::class, function (Faker\Generator $faker) {
      return [
          'title' =&gt; $faker-&gt;sentence,
          'content' =&gt; $faker-&gt;paragraph,
          'tags' =&gt; $faker-&gt;word,
          'user_id' =&gt; dixard\User::all()-&gt;random()-&gt;id,
          'category_id' =&gt; dixard\BlogCategory::all()-&gt;random()-&gt;id,
      ];
  });
  </code></pre>
  
  <blockquote>
    <p>user_type can be 0 (customer), 1(artist), 3(admin) is a bolean field.</p>
  </blockquote>
  
  <p>databaseSeeder.php</p>
  
  <pre><code>public function run()
      {
          Model::unguard();
  
          factory('dixard\User','admin', 3)-&gt;create();
          factory('dixard\BlogCategory', 5)-&gt;create();
          factory('dixard\Article', 20)-&gt;create();
  
  
          // $this-&gt;call(UserTableSeeder::class);
          $this-&gt;call(CategoryTableSeeder::class);
          $this-&gt;call(GenderTableSeeder::class);
          $this-&gt;call(ProductTableSeeder::class);
          $this-&gt;call(ColorTableSeeder::class);
          $this-&gt;call(BalanceTableSeeder::class);
          $this-&gt;call(ShippingsTableSeeder::class);
          $this-&gt;call(CouponTableSeeder::class);
  
          Model::reguard();
      }
  </code></pre>
  
  <p>Thank you for your help! </p>