/** * Run the database seeds. * * @return void */ public function run() { //Truncate DB::statement('SET FOREIGN_KEY_CHECKS=0;'); User::truncate(); Admin::truncate(); Customer::truncate(); Address::truncate(); Category::truncate(); Product::truncate(); Brand::truncate(); Type::truncate(); Image::truncate(); DB::statement('TRUNCATE category_product;'); Product::clearIndices(); Product::reindex(); //Unguard Model::unguard(); //Call $this->call(UsersTableSeeder::class); $this->call(ProductsTableSeeder::class); //Reguard Model::reguard(); DB::statement('SET FOREIGN_KEY_CHECKS=1;'); }