←Back

How To Add A New Column To An Existing Table In Laravel?

php artisan make:migration add_column_name_to_table_name --table=table_name

Replace "column_name" with your new column's name and "table_name" with the name of the table you want to change.

Place new column after another (with a default, especially if you already have a seeder)

$table->integer('paid')->after('email')->default('1');

Run the migration:

php artisan migrate --path=/database/migrations/yyyy_mm_dd_hhmmss_add_column_name_to_table_name.php

When re-running a migration and getting ‘nothing to migrate’, run (with your own relative table path);

php artisan migrate:rollback --path=/database/migrations/2025_04_17_183023_add_shares_to_mixes.php