Answers for "laravel 8 migration create new column"

PHP
6

laravel create migration add column

php artisan make:migration add_paid_to_users_table --table=users
Posted by: Guest on April-30-2020
0

how add new column in larevel with migration

php artisan make:migration add_paid_to_users_table --table=users


public function up()
{
    Schema::table('users', function($table) {
        $table->integer('paid');
    });
}
and don't forget to add the rollback option:

public function down()
{
    Schema::table('users', function($table) {
        $table->dropColumn('paid');
    });
}
Posted by: Guest on January-14-2022

Code answers related to "laravel 8 migration create new column"

Browse Popular Code Answers by Language