Cara menghapus (drop) table di Laravel

 


You can use drop or dropIfExists methods:

Schema::drop('users');

Schema::dropIfExists('users');

You can also rollback if you want to drop your last migrated table

php artisan migrate:rollback

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

php artisan migrate:reset

The migrate:fresh command will drop all tables from the database and then execute the migrate command:

php artisan migrate:fresh

php artisan migrate:fresh --seed

Posting Komentar

Lebih baru Lebih lama