Laravel migration artisan commands

To create new migration

php artisan make:migration create_products_table

To run the migrations

php artisan migrate

To check the status of migrations

php artisan migrate:status

To rollback latest migration

php artisan migrate:rollback

To rollback last n migration

php artisan migrate:rollback --step=n

To rollback all the migrations of an application

php artisan migrate:reset

To rollback all the migrations and run the migrate command

php artisan migrate:refresh

Refresh the database and seed the database with new data

php artisan migrate:refresh --seed

Rollback and remigrate last n migrations

php artisan migrate:refresh --step=5
© 2016 - 2022, All Rights are Reserved.