src/Schema.php
public function alter(string $table, callable $callback)
    {
        $compiler = $this->connection->schemaCompiler();

        $schema = new AlterTable($table);

        $callback($schema);

        unset($this->columns[strtolower($table)]);

        foreach ($compiler->alter($schema) as $result) {
            $this->connection->command($result['sql'], $result['params']);
        }
    }
public function alter(string $table, callable $callback)
    {
        $compiler = $this->connection->schemaCompiler();

        $schema = new AlterTable($table);

        $callback($schema);

        unset($this->columns[strtolower($table)]);

        foreach ($compiler->alter($schema) as $result) {
            $this->connection->command($result['sql'], $result['params']);
        }
    }
public function alter ( string $ table , callable $ callback ) { $ compiler = $ this -> connection -> schemaCompiler ( ) ; $ schema = new AlterTable ( $ table ) ; $ callback ( $ schema ) ; unset ( $ this -> columns [ strtolower ( $ table ) ] ) ; foreach ( $ compiler -> alter ( $ schema ) as $ result ) { $ this -> connection -> command ( $ result [ 'sql' ] , $ result [ 'params' ] ) ; } }
Alters a table's definition

@param   string $table Table name
@param   callable $callback A callback that will add or remove fields or indexes
@throws \Exception
Alters a table s definition