public function run() { Maker::truncate(); $faker = Faker::create(); for ($i = 0; $i < 200; $i++) { Maker::create(['name' => $faker->word(), 'phone' => $faker->randomDigit(5)]); } }
/** * 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'); }
/** * 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(); }
/** * 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'); }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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;'); }