Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

cola's avatar
Level 1

How can I undo migration or delete all tables with php artisan?

php artisan migrate created all tables. How can I undo migration or delete all tables with php artisan?

0 likes
3 replies
MahmoudMonem's avatar

You can Rollback all migrations with

php artisan migrate:reset

saurav77's avatar

@cola

You can also use migrate:fresh in newer Laravel versions or you can use

Route::get('/delete-table', function () {
    return Artisan::call('migrate:reset', ['--force' => true]);
});

Please or to participate in this conversation.