how to migrate new column without empty the table in laravel

Solutions on MaxInterview for how to migrate new column without empty the table in laravel by the best coders in the world

showing results for - "how to migrate new column without empty the table in laravel"
Tino
18 Apr 2017
1Use below command to modify the existing table
2
3php artisan make:migration add_shipped_via_and_terms_colums_to_purchase_orders_table --table=purchase_orders
4use --create for creating the new table and --table for modifying the existing table.
5
6Now a new migration file will be created. Inside the up() function in this file add these line
7
8Schema::table('purchase_orders', function(Blueprint $table){
9    $table->string('shipped_via');
10    $table->string('terms');
11});
12And then run php artisan migrate
Mattia
01 Jul 2018
1php artisan make:migration add_shipped_via_and_terms_colums_to_purchase_orders_table --table=purchase_orders