Answers for "column name change in laravel migration"

PHP
12

laravel rename column name

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

migration rename column laravel

public function up()
{
    Schema::table('posts', function (Blueprint $table) {
        $table->renameColumn('author_ID', 'user_id');
    });
}
Posted by: Guest on February-09-2021

Code answers related to "column name change in laravel migration"

Browse Popular Code Answers by Language