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('form_property');
     $this->faker = Faker::create();
     $formIds = Form::lists('id');
     $propertyIds = Property::lists('id');
     for ($i = 0; $i < 40; $i++) {
         $ids = $this->getUniqueIds($formIds, $propertyIds);
         DB::table('form_property')->insert(['form_id' => $ids['form_id'], 'property_id' => $ids['property_id'], 'label' => $this->faker->sentence(2), 'default' => $this->faker->word, 'required' => $this->faker->boolean(25), 'created_at' => $this->now, 'updated_at' => $this->now]);
     }
 }
Пример #3
0
<?php

use SevenShores\Kraken;
$propertyIds = Kraken\Property::lists('id');
$factory(Kraken\PropertyOption::class, ['value' => $faker->word, 'label' => $faker->word, 'property_id' => $faker->randomElement($propertyIds)]);