How to Add a Column or Columns To Existing Table In Laravel

In this tutorial you will learn about the How to Add a Column or Columns To Existing Table In Laravel and its application with practical example.

In this How to Add a Column or Columns To Existing Table In Laravel tutorial, I will show you how to add a culumn or columns to existing table in laravel. In this tutorial you will learn add one or multiple columns to database table using migration in laravel. In this article I will show you different ways you can alter existing table schema using migrations in laravel.

How to Add a Column or Columns To Existing Table In Laravel

In this step by step guide I will demonstrate you how to add new columns or columns to an existing table using Laravel migration.

Laravel Migration:

  • Add a single Column an existing table
  • Add Multiple Columns in Existing Table
  • Available Column Types

Add a single Column an existing table

Below is the example command to add single column to existing table.

It will create an add_type_to_notes file in the migration folder. It should be like this-

Run Migration Command

Now, run the following command to migrate table schema,

Add Multiple Columns in Existing Table

Below is the example command to add multiple column to existing table.

The above command will create a migration file, so go to database/migration folder and open your file and add column according to you:


Finally, run the below-given command for adding columns in your database table:

Available Column Types

In this tutorial we have learn about the How to Add a Column or Columns To Existing Table In Laravel and its application with practical example. I hope you will like this tutorial.