Drop all tables

Submitted by naneri - 7 months ago

This is usefull for migrations when you can't rollback. Can easily be run in artisan mode or you can create a console command.

foreach(\DB::select('SHOW TABLES') as $table) {
    $table_array = get_object_vars($table);
    \Schema::drop($table_array[key($table_array)]);
}
comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks