When you check the migration table in Laravel, you can see a batch number with every record. So, when you run the rollback command, it rolls back each migration that was part of the last migration.
php artisan migrate:rollback
The above command will roll back the last batch of migrations which may include multiple migration files.
On the other hand, you can use the step argument to indicate, steps of the migration to roll back. For example, the following command will roll back the last three migrations:
php artisan migrate:rollback --step=3
There is another command migrate:reset
will reset all the migrations in your application.
php artisan migrate:reset
- Just want to thank us? Buy us a Coffee
- May be another day? Shop on Amazon using our links.
Your prices won't change but we get a small commission.
Leave a Reply