-
-
Save locopine/3f8d9721e9cf3995fbc8427aac667bdf to your computer and use it in GitHub Desktop.
Laravel drop tables via artisan command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php artisan tinker | |
$tables = DB::select('SHOW TABLES'); | |
$tables_in_database = "Tables_in_".Config::get('database.connections.mysql.database'); | |
DB::statement('SET FOREIGN_KEY_CHECKS=0;'); | |
foreach ($tables as $table) { | |
Schema::drop($table->$tables_in_database); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment