create(); User::truncate(); $this->prepareNewSeed(); User::factory()->create([ 'name' => 'Test User', 'email' => 'test@example.com', ]); $this->call(TagSeeder::class); $this->call(TaskSeeder::class); } protected function prepareNewSeed(): void { DB::statement('SET FOREIGN_KEY_CHECKS=0'); DB::table('tag_task')->truncate(); Tag::truncate(); Task::truncate(); DB::statement('SET FOREIGN_KEY_CHECKS=1'); } }