src/Database/Migration.php
public static function renameColumns($tableName, array $columnNames)
    {
        return [
            'up' => function (Builder $schema) use ($tableName, $columnNames) {
                $schema->table($tableName, function (Blueprint $table) use ($columnNames) {
                    foreach ($columnNames as $from => $to) {
                        $table->renameColumn($from, $to);
                    }
                });
            },
            'down' => function (Builder $schema) use ($tableName, $columnNames) {
                $schema->table($tableName, function (Blueprint $table) use ($columnNames) {
                    foreach ($columnNames as $to => $from) {
                        $table->renameColumn($from, $to);
                    }
                });
            }
        ];
    }
public static function renameColumns($tableName, array $columnNames)
    {
        return [
            'up' => function (Builder $schema) use ($tableName, $columnNames) {
                $schema->table($tableName, function (Blueprint $table) use ($columnNames) {
                    foreach ($columnNames as $from => $to) {
                        $table->renameColumn($from, $to);
                    }
                });
            },
            'down' => function (Builder $schema) use ($tableName, $columnNames) {
                $schema->table($tableName, function (Blueprint $table) use ($columnNames) {
                    foreach ($columnNames as $to => $from) {
                        $table->renameColumn($from, $to);
                    }
                });
            }
        ];
    }
public static function renameColumns ( $ tableName , array $ columnNames ) { return [ 'up' => function ( Builder $ schema ) use ( $ tableName , $ columnNames ) { $ schema -> table ( $ tableName , function ( Blueprint $ table ) use ( $ columnNames ) { foreach ( $ columnNames as $ from => $ to ) { $ table -> renameColumn ( $ from , $ to ) ; } } ) ; } , 'down' => function ( Builder $ schema ) use ( $ tableName , $ columnNames ) { $ schema -> table ( $ tableName , function ( Blueprint $ table ) use ( $ columnNames ) { foreach ( $ columnNames as $ to => $ from ) { $ table -> renameColumn ( $ from , $ to ) ; } } ) ; } ] ; }
Rename multiple columns.
Rename multiple columns .