MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Rolling Back migration in Laravel.

Rollback command is used to rollback the last migration means remove the last migration from the database. Laravel provides different commands to rollback tables from the database, these are:-

1. php artisan migrate:rollback :- It rollback the last migration we have migrated. See below:-

Terminal output of php artisan migrate:rollback rolling back only the last demo_mg migration

2. php artisan migrate:rollback –step=(No.-of-migrations) :- It rollback the limited number of last migrations (no. is provided after step) from the database. See below:-

Terminal output of php artisan migrate:rollback --step=3 rolling back the last three migrations

In the above example, Step=3 means it rollback last 3 migrations. So after the execution of command as you see that last 3 migrations are rollbacked.

3. php artisan migrate:reset :- It will rollback all the migrations from the database with only one command.

Terminal output of php artisan migrate:reset rolling back all four migrations

4. php artisan migrate:refresh :- After calling refresh, it first rollback all the migrations and then execute migrate command automatically. This command effectively re-creates your entire database. See below:-

Terminal output of php artisan migrate:refresh rolling back all migrations, then migrating them again

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
With MotoShare.in, you can book a bike instantly, enjoy doorstep delivery, and ride without worries. Perfect for travelers, professionals, and adventure enthusiasts looking for a seamless mobility solution.

Related Posts

How to display a table in a Verticle or Horizontal form in the Laravel PHP Framework? Part-1

How to display a table in a Verticle or Horizontal form in the Laravel PHP Framework? How to Store Seed file into Database. Click There are two…

Read More

HOW TO CREATE EVENT CALENDAR IN LARAVEL? PART-3

Step 1.Create a Database in phpMyAdmin. (Write the same name of database which was written in .enf databse name). Step 2.  We use the migrate command to…

Read More

HOW TO CREATE EVENT CALENDAR IN LARAVEL? PART-2

Step 1.Create a Laravel Project Firstly, Create a new project in laravel, so we open Git Bash,  Go to My Computer/This PC–>LocalDisk(C:)–>Xampp–>Htdocs (Press right click on Mouse)…

Read More

How to file upload in DB With local folder using laravel 5.8

Step:1 you have to make these(A) – php artisan make:controller ImageUploadController(B) – php artisan make:model ImageUpload -m Step:2 Open the welcome.blade.php page then write this code. Step:3…

Read More

How to Store Countries, States, Cities seed classes into the Database in Laravel PHP? (Part-3)

How to Store Countries, States, Cities seed classes into the Database in Laravel PHP Part-1 Part- 2 Step 1. Create a City seeder file. Write down the…

Read More

How to Store Countries, States, Cities seed classes into the Database in Laravel PHP? (Part-1)

How to Store Countries, States, Cities seed classes into the Database in Laravel PHP? Part- 2 Part- 3 Step 1. Create a Country seeder file. Write down…

Read More