示例#1
0
 public function run()
 {
     Maker::truncate();
     $faker = Faker::create();
     for ($i = 0; $i < 200; $i++) {
         Maker::create(['name' => $faker->word(), 'phone' => $faker->randomDigit(5)]);
     }
 }
示例#2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     Maker::truncate();
     User::truncate();
     Model::unguard();
     $this->call('MakerSeed');
     $this->call('VehiclesSeed');
     $this->call('UsersSeed');
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     //Truncate statement of MySQL
     Maker::truncate();
     Model::unguard();
     // $this->call('UserTableSeeder');
     $this->call('MakerSeed');
     $this->call('VehicleSeed');
 }
示例#4
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     Model::unguard();
     Maker::truncate();
     //delete the previous db data and then seed the db
     Vehicle::truncate();
     $this->call('MakerTableSeeder');
     $this->call('VehicleTableSeeder');
     Model::reguard();
 }
示例#5
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     Maker::truncate();
     User::truncate();
     DB::table('oauth_clients')->truncate();
     Model::unguard();
     $this->call('MakerSeed');
     $this->call('VehiclesSeed');
     $this->call('UsersSeed');
     $this->call('OauthClientSeed');
 }
示例#6
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //Para que no tenga en cuenta la clave externa de makers en vehicles y permita el truncado
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     //Para truncar todos los datos
     Maker::truncate();
     User::truncate();
     Model::unguard();
     $this->call('MakerSeed');
     $this->call('VehiclesSeed');
     $this->call('UsersSeed');
     Model::reguard();
 }
示例#7
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::statement('SET FOREIGN_KEY_CHECKS=0');
     Maker::truncate();
     Vehicle::truncate();
     User::truncate();
     DB::statement('SET FOREIGN_KEY_CHECKS=1');
     Model::unguard();
     $this->call(MakerTableSeeder::class);
     $this->call(VehicleTableSeeder::class);
     $this->call(UserTableSeeder::class);
     Model::reguard();
 }
示例#8
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     // Important: Must truncate table before seeding
     User::truncate();
     Maker::truncate();
     DB::table('oauth_clients')->truncate();
     Model::unguard();
     $this->call(MakerSeed::class);
     $this->call(VehicleSeed::class);
     $this->call(UserSeed::class);
     $this->call(OAuthClientSeed::class);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     Maker::truncate();
     // clear Everytime new Faker data
     User::truncate();
     // clear  Everytime new Faker data
     Model::unguard();
     // $this->call(UserTableSeeder::class);
     $this->call('MakerSeed');
     $this->call('VehiclesSeed');
     $this->call('UsersSeed');
     Model::reguard();
 }
示例#10
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //disable foreign key check for this connection before running seeders
     DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     Vehicle::truncate();
     Maker::truncate();
     User::truncate();
     Model::unguard();
     $this->call('MakersSeed');
     $this->call('VehiclesSeed');
     $this->call('UsersSeed');
     //might not be necessary
     DB::statement('SET FOREIGN_KEY_CHECKS=1;');
 }