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

        $schema = new CreateTable($table);

        $callback($schema);

        foreach ($compiler->create($schema) as $result) {
            $this->connection->command($result['sql'], $result['params']);
        }

        //clear table list
        $this->tableList = null;
    }
public function create(string $table, callable $callback)
    {
        $compiler = $this->connection->schemaCompiler();

        $schema = new CreateTable($table);

        $callback($schema);

        foreach ($compiler->create($schema) as $result) {
            $this->connection->command($result['sql'], $result['params']);
        }

        //clear table list
        $this->tableList = null;
    }
public function create ( string $ table , callable $ callback ) { $ compiler = $ this -> connection -> schemaCompiler ( ) ; $ schema = new CreateTable ( $ table ) ; $ callback ( $ schema ) ; foreach ( $ compiler -> create ( $ schema ) as $ result ) { $ this -> connection -> command ( $ result [ 'sql' ] , $ result [ 'params' ] ) ; } //clear table list $ this -> tableList = null ; }
Creates a new table

@param   string $table Table name
@param   callable $callback A callback that will define table's fields and indexes
@throws \Exception
Creates a new table