Skip to content

Instantly share code, notes, and snippets.

@sohelamin
Created November 18, 2015 18:53
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save sohelamin/9695b7037dd09afcc9d9 to your computer and use it in GitHub Desktop.
Save sohelamin/9695b7037dd09afcc9d9 to your computer and use it in GitHub Desktop.
Laravel drop tables via artisan command
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);
}
@saniul-binate-solutions

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment