How to Create Table Migration in Laravel 9?




How to Create Table Migration in Laravel 9?

Hi Guys,

In this example, I will learn you how to create table migration in laravel 9. you can easily and simply create table migration in laravel 9. you will learn laravel to create a table using migration. you will do the following things to create a table in laravel using migration.

I will also let you know how to run migration and rollback migration and how to create migration using a command in laravel 9. let's see below instruction.

Download Laravel

Let us begin the tutorial by installing a new laravel application. if you have already created the project, then skip following step.

composer create-project laravel/laravel example-app

Create Migration:

Using bellow command you can simply create migration for database table.

php artisan make:migration create_posts_table

After run above command, you can see created new file as bellow and you have to add new column for string, integer, timestamp and text data type as like bellow:



use Illuminate\Database\Migrations\Migration;

use Illuminate\Database\Schema\Blueprint;

use Illuminate\Support\Facades\Schema;

class CreatePostTable extends Migration



* Run the migrations.


* @return void


public function up()


Schema::create('posts', function (Blueprint $table) {












* Reverse the migrations.


* @return void


public function down()





Run Migration:

Using bellow command we can run our migration and create database table.

php artisan migrate

Create Migration with Table:

php artisan make:migration create_posts_table --table=posts

Migration Rollback:

php artisan migrate:rollback

It will help you...

#Laravel 9