option('force') && !$this->confirm('Are you sure want to drop data for your Cattr instance?')) { return 0; } DB::statement('SET FOREIGN_KEY_CHECKS=0;'); $tables = DB::connection()->getDoctrineSchemaManager()->listTableNames(); foreach ($tables as $table) { if (!in_array($table, $this->protectedTables, true)) { DB::table($table)->truncate(); } } DB::statement('SET FOREIGN_KEY_CHECKS=1;'); if ($this->option('images')) { Storage::deleteDirectory('uploads/screenshots'); } $this->call(SeedCommand::class, [ '--class' => 'InitialSeeder', '--force' => true ]); if ($this->option('seed')) { $this->call(SeedCommand::class, [ '--force' => true ]); $this->call(ModuleSeedCommand::class, [ '--force' => true ]); } return 0; } }