Laravel Drop all tables with MySQL

Today, We want to share with you Laravel Drop all tables with MySQL.In this post we will show you “Drop all tables” instead of “migration rollback”, hear for mysql move table to another database, Laravel – Delete all records from table query we will give you demo and example for implement.In this post, we will learn about Drop tables, types and views using wipe artisan command in Laravel 6 with an example.

Laravel Drop all tables with MySQL

There are the Following The simple About laravel migration change column type Full Information With Example and source code. according to me best database for node js.

As I will cover this Post with live Working example to develop laravel delete all relations, so the laravel truncate table with foreign key is used for this example is following below.

Delete all the tables in database in one shot

migrations when you can’t rollback.

foreach(\DB::select('SHOW TABLES') as $table) {
    $all_table_names = get_object_vars($table);
php artisan migrate:reset

The migrate:reset command will roll back all of your application’s migrations:

Artisan::call('migrate:reset', ['--force' => true]);

truncate all tables in laravel using eloquent

//Get all the table names
$all_table_names = Schema::getConnection()->getDoctrineSchemaManager()->listTableNames();

foreach ($all_table_names as $name) {
    //if you don't want to truncate migrations in Database
    if ($name == 'migrations') {

Laravel 6 Session More Details

Laravel – Delete all records from table query

Example 1:


Example 2:


Example 3:

Product:where('id', 'like' '%%')->delete();

Example 4:

Web Programming Tutorials Example with Demo

Read :


You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about laravel truncate table with foreign key.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment