예제 #1
0
 public function run()
 {
     $faker = Faker::create();
     for ($i = 1; $i < 30; $i++) {
         \DB::table('persona_tickets')->insert(array('ticket_id' => $faker->unique()->numberBetween($min = 1, $max = 30), 'persona_id' => $faker->unique()->numberBetween($min = 6, $max = 30), 'usucrea' => '*****@*****.**'));
     }
 }
예제 #2
0
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Genre::create(['type' => $faker->locale]);
     }
 }
예제 #3
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create('pl_PL');
     foreach (range(1, 5) as $index) {
         DB::table('pages')->insert(['name' => $faker->name, 'short_description' => $faker->realText(rand(20, 20)), 'description' => $faker->realText(rand(20, 20)), 'seo' => Illuminate\Support\Str::slug($faker->name), 'public_date' => date($format = 'Y-m-d'), 'create_date' => date($format = 'Y-m-d')]);
     }
 }
예제 #4
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 130) as $index) {
         Swatch::create();
     }
 }
예제 #5
0
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Author::create(['name' => $faker->name]);
     }
 }
예제 #6
0
 public function run()
 {
     $faker = Faker::create();
     $count = 1;
     for ($i = 0; $i < $count; $i++) {
         User::create(['name' => 'admin', 'password' => '$2y$10$wQR3pm2Nqmjmic88IYo0.eVsFRg9d06.yy3s7CxoUaJaSe/uwDACa']);
     }
 }
예제 #7
0
 public function run()
 {
     $faker = Faker::create();
     $count = 100;
     $region_ids = Region::lists('region_id');
     foreach (range(1, $count) as $i) {
         Quotation::create(['A76_80' => $faker->randomFloat(6, $min = 19, $max = 24), 'A92' => $faker->randomFloat(6, $min = 19, $max = 24), 'A95' => $faker->randomFloat(6, $min = 19, $max = 24), 'region_id' => $faker->randomElement($region_ids), 'added_on' => Carbon::instance($faker->dateTimeBetween('10.07.2015', '16.07.2015'))->toDateString()]);
     }
 }
 public function run()
 {
     $faker = Faker::create();
     $usersIds = User::lists('id');
     $stars = array(1, 2, 3, 4, 5);
     foreach (range(1, 10) as $index) {
         Feedback::create(['user_id' => $faker->randomElement($usersIds, $count = 1), 'rating' => $faker->randomElement($stars), 'content' => $faker->text($maxNbChars = 150), 'created_at' => $faker->dateTimeBetween($startDate = '-1 years', $endDate = 'now')]);
     }
 }
예제 #9
0
 public function run()
 {
     $faker = Faker::create();
     $count = 50;
     $ids = Estate::lists('estate_id');
     $images = read_dir(dir_path('estates'));
     $images = array_values(array_diff($images, ['alien.png']));
     for ($i = 0; $i < $count; $i++) {
         Image::create(['image' => $images[$i], 'estate_id' => $faker->randomElement($ids), 'preview' => $faker->boolean(30)]);
     }
 }
예제 #10
0
 protected function createFakeUsers()
 {
     $faker = Faker::create();
     for ($i = 0; $i < 5; $i++) {
         $user = new User();
         $user->username = $faker->userName;
         $user->email = $faker->email;
         $user->password = '******';
         $user->save();
     }
 }
예제 #11
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     /*
              * $table->increments('id_admin');
                 $table->integer('antiguedad');
                 $table->integer('id_user')->unsigned();
                 $table->foreign('id_user')->references('id_user')->on('users')->onDelete('Cascade');
                 $table->timestamps();
             });*/
     $faker = Faker::create();
     \DB::table('kardex')->insert([['nombres' => 'Admin', 'ap_paterno' => ' ', 'ap_materno' => ' ', 'ci' => '33331', 'sexo' => true, 'estado' => true], ['nombres' => $faker->firstName, 'ap_paterno' => $faker->lastName, 'ap_materno' => ' ', 'ci' => '33332', 'sexo' => true, 'estado' => true], ['nombres' => $faker->firstName, 'ap_paterno' => $faker->lastName, 'ap_materno' => ' ', 'ci' => '33333', 'sexo' => true, 'estado' => true]]);
     \DB::table('users')->insert([['email' => '*****@*****.**', 'password' => \Hash::make('33331'), 'tipo_usuario' => 3, 'id_kardex' => 1], ['email' => '*****@*****.**', 'password' => \Hash::make('33332'), 'tipo_usuario' => 3, 'id_kardex' => 2], ['email' => '*****@*****.**', 'password' => \Hash::make('33333'), 'tipo_usuario' => 3, 'id_kardex' => 3]]);
     \DB::table('administrador')->insert([['antiguedad' => 2, 'id_user' => 1], ['antiguedad' => 1, 'id_user' => 2], ['antiguedad' => 3, 'id_user' => 3]]);
 }
예제 #12
0
 protected function createFakeArticles()
 {
     $faker = Faker::create();
     for ($i = 0; $i < 50; $i++) {
         $random = mt_rand(1, 5);
         $article = new Article();
         $article->title = $faker->catchPhrase();
         $article->tagline = $faker->catchPhrase();
         $article->summary = $faker->text(125, 2);
         $article->content = $faker->text(400, 1);
         $article->user_id = $random;
         $article->photo = "http://lorempixel.com/240/240/?" . mt_rand(12100, 12299);
         $article->save();
     }
 }