public function run()
 {
     $faker = Faker\Factory::create();
     Project::truncate();
     foreach (range(1, 20) as $index) {
         Project::create(['title' => $faker->word, 'image' => $faker->imageUrl(300, 200), 'location' => $faker->country, 'size_width' => $faker->numberBetween(5, 20), 'size_length' => $faker->numberBetween(10, 30), 'story' => $faker->paragraph(4)]);
     }
 }
示例#2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     \App\Project::truncate();
     \App\Company::truncate();
     \App\User::truncate();
     Model::unguard();
     $this->call(ProjectsTableSeeder::class);
     $this->call(CompaniesTableSeeder::class);
     $this->call(UsersTableSeeder::class);
     Model::reguard();
 }