Answers for "change column name and type laravel migration"

PHP
12

laravel migration change column name

Schema::table('users', function (Blueprint $table) {
    $table->renameColumn('from', 'to');
});
Posted by: Guest on April-24-2020
0

laravel change column type

composer require doctrine/dbal

public function up()
{
    Schema::table('sometable', function (Blueprint $table) {
        $table->text('text')->change();
    });
}
Posted by: Guest on August-16-2021
0

laravel change column type

php artisan make:migration change_sometable_in_finance_table --table=finance

public function up()
{
    Schema::table('sometable', function (Blueprint $table) {
        $table->text('text')->change();
    });
}
Posted by: Guest on September-14-2021

Code answers related to "change column name and type laravel migration"

Browse Popular Code Answers by Language