コード例 #1
0
 public function run()
 {
     $faker = Faker\Factory::create();
     Profile::truncate();
     foreach (range(1, 20) as $index) {
         Profile::create(['first_name' => $faker->firstName, 'last_name' => $faker->lastName, 'job' => $faker->word, 'motto' => $faker->sentence, 'about' => $faker->paragraph(4), 'favorite' => $faker->paragraph(4), 'favorite_img' => $faker->imageUrl(300, 200), 'sample_img1' => $faker->imageUrl(300, 200), 'sample_img2' => $faker->imageUrl(300, 200), 'sample_img3' => $faker->imageUrl(300, 200), 'location' => $faker->country, 'phone' => $faker->phoneNumber]);
     }
 }
コード例 #2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // clear table
     \App\Profile::truncate();
     // add 1st row
     \App\Profile::create(['user_id' => 1, 'firstname' => 'Хангал', 'lastname' => 'Жаргалсайхан', 'headline' => 'Оюутан', 'address' => 'БГД-н 4-р хороолол 45-20', 'desired_salary' => 800000, 'phone' => '89237842', 'summary' => 'Laravel Framework ашиглах болон, Full stack development хийх сонирхолтой']);
     // add 2nd row
     \App\Profile::create(['user_id' => 2, 'firstname' => 'Khangal', 'lastname' => 'Kola', 'headline' => 'Undergraduate', 'address' => 'New York', 'phone' => '12345678', 'summary' => 'I wanna be a rockstar.']);
 }