MWZ

MINDWAREZONE

intermediateLaravel

What is the difference between migrate:rollback, migrate:reset, and migrate:fresh?

Answer

Clear, interview-ready explanation

php artisan migrate:rollback reverses the most recent migration batch by default, or a specified number of batches with options. It is useful when a recently applied local change needs to be undone and the down methods are safe and complete.

migrate:reset rolls back all migrations. migrate:fresh drops all tables and then runs migrations from scratch, so it destroys existing database data and is normally suitable only for local development or controlled test environments. Neither reset nor fresh should be used casually against production data.