laravel migration column change code example

Example 1: laravel change column

Schema::table('users', function (Blueprint $table) {
    $table->string('name', 50)->nullable()->change();
});

Example 2: laravel migration change column type

public function up()
{
    Schema::table('sometable', function (Blueprint $table) {
        $table->text('text')->change();
    });
}

Example 3: how to make-migrations in laravel

php artisan make:migration create_users_table --create=users

php artisan make:migration add_votes_to_users_table --table=users

Example 4: laravel migration

$table->string('name', 100);

Tags:

Php Example