G.G.
0
Q:

add new column in existing table in laravel migration

php artisan make:migration add_paid_to_users_table --table=users
  
public function up()
{
    Schema::table('users', function($table) {
        $table->integer('paid');
    });
}

public function down()
{
    Schema::table('users', function($table) {
        $table->dropColumn('paid');
    });
}

php artisan migrate
6
php artisan make:migration add_paid_to_users_table --table=users
0
Schema::table('table_name', function (Blueprint $table) {
            $table->string('column_name', 255)->nullable()->after('previous_column_name');
        });
2
public function down()
{
    Schema::table('users', function($table) {
        $table->dropColumn('paid');
    });
}
1
php artisan migrate
0
migration add column to existing table in laravel 6 
0
public function up()
{
    Schema::table('users', function($table) {
        $table->integer('paid');
    });
}
0

New to Communities?

Join the community