Answers for "laravel modify column with 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 migration change column order

public function up()
{

    DB::statement("ALTER TABLE example MODIFY COLUMN foo DATE AFTER bar");

}

public function down()
{

    DB::statement("ALTER TABLE example MODIFY COLUMN foo DATE AFTER bar");

}
Posted by: Guest on December-16-2020

Code answers related to "laravel modify column with migration"

Browse Popular Code Answers by Language