Sometimes we need to rollback one specific migration. Here, in this article we will discuss about the migration rollback in laravel.
As we know that laravel migration provides very simple way to create database table structure. We need to create migration file and write table structure then migrate that migration. Sometimes we need to rollback that migration. So here we will discuss about the migration rollback in laravel.
We can run the rollback artisan command to rollback on a particular step. We can execute the following artisan command.
php artisan migrate:rollback --step=1
Every time when we will rollback, we will get the last batch of migration.
*Note: *This rollback command will work on laravel 5.3 or above version. For the version below 5.3, there is no command available for migration rollback in laravel.
We can also use the following command to rollback and re migrate.
php artisan migrate:refresh --step=2
It will rollback and remigrate last two migration.
You can also checkout the article for executing single migration by clicking on the link below.
laravel how to perform rollback migration in laravel laravel migration rollback migration refresh in laravel migration rollback batch in laravel migration rollback for one specific migration migration rollback in laravel
If we run normal migrate command it will migrate all the migrations but here i will let you know to migrate single migration in laravel.
here in this article i will let you know laravel create model migration and controller in a single php artisan command. You can create resource controller.
To move or not to move? Benefits are multifold when you are migrating to the cloud. Get the correct information to make your decision, with our cloud engineering expertise.
In this article i will let you know to delete multiple rows through checkbox using ajax in laravel and before delete we will give a confirmation message.
Spread the loveHow to get relationship from relationship using With() in Laravel Some times there are cases where you want to get relationship from relationship in Laravel, that can be achieved via following: How to create multiple where clauses in…Read More→