コード例 #1
0
 public function run()
 {
     $this->truncateTable('contact_property');
     $faker = Faker::create();
     $contactIds = Contact::lists('id');
     $propertyIds = Property::lists('id');
     for ($i = 0; $i < 20; $i++) {
         DB::table('contact_property')->insert(['contact_id' => $faker->randomElement($contactIds), 'property_id' => $faker->randomElement($propertyIds), 'value' => $faker->word, 'created_at' => $this->now, 'updated_at' => $this->now]);
     }
 }
コード例 #2
0
 public function run()
 {
     $this->truncateTable('taggables');
     $faker = Faker::create();
     $tagIds = Tag::lists('id');
     $contactIds = Contact::lists('id');
     for ($i = 0; $i < 40; $i++) {
         DB::table('taggables')->insert(['tag_id' => $faker->randomElement($tagIds), 'taggable_id' => $faker->randomElement($contactIds), 'taggable_type' => Contact::class]);
     }
 }
コード例 #3
0
 public function run()
 {
     $this->truncateTable('contact_form');
     $faker = Faker::create();
     $contactIds = Contact::lists('id');
     $formIds = Form::lists('id');
     for ($i = 0; $i < 20; $i++) {
         DB::table('contact_form')->insert(['contact_id' => $faker->randomElement($contactIds), 'form_id' => $faker->randomElement($formIds), 'created_at' => $this->now, 'updated_at' => $this->now]);
     }
 }