Laravel 11 Create, Run and Rollback Migration

In this guide, we'll see how to create, run, and roll back migration in laravel 11. Migrations are like version control for your database. Also, see run specific migration in laravel 11 and roll back specific migration in laravel 11.

A migration class contains two methods: up and down. The up method is used to add new tables, columns, or indexes to your database, while the down method should reverse the operations performed by the up method.

Create Migration

First, we'll create a migration using the following command.

php artisan make:migration create_blogs_table

After running the above command, you will see a new file in the database/migration folder.


use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
     * Run the migrations.
    public function up(): void
        Schema::create('blogs', function (Blueprint $table) {
     * Reverse the migrations.
    public function down(): void


Run Migration

Then, we'll migrate the migration into the database using the following command.

php artisan migrate



Run Specific Migration

Run a specific migration using the following command.

php artisan migrate --path=/database/migrations/2024_04_06_144031_create_blogs_table.php


Migration Rollback

Rollback a migration using the following command:

php artisan migrate:rollback


Rollback Specific Migration

Roll back a specific migration using the following command.

php artisan migrate:rollback --path=database/migrations/2024_04_06_144031_create_blogs_table.php


Rest Migration

Reset migration will roll back all the application's migrations.

php artisan migrate:reset



In addition to the column types listed above, there are several column "modifiers" you may use when adding a column to a database table. 

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
Schema::table('users', function (Blueprint $table) {


Dropping Columns

To drop a column, you may use the dropColumn method on the schema builder:

Schema::table('users', function (Blueprint $table) {

Schema::table('users', function (Blueprint $table) {
    $table->dropColumn(['votes', 'avatar', 'location']);


You might also like:


Techsolutionstuff | The Complete Guide

I'm a software engineer and the founder of Hailing from India, I craft articles, tutorials, tricks, and tips to aid developers. Explore Laravel, PHP, MySQL, jQuery, Bootstrap, Node.js, Vue.js, and AngularJS in our tech stack.