Answers for "migration change column name laravel"

PHP
1

laravel change column

Schema::table('users', function (Blueprint $table) {
    $table->string('name', 50)->nullable()->change();
});
Posted by: Guest on April-02-2020
1

migration rename column laravel

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

Code answers related to "migration change column name laravel"

Browse Popular Code Answers by Language