Mellivora/Database/Schema/Blueprint.php
public function toSql(Connection $connection, Grammar $grammar)
    {
        $this->addImpliedCommands();

        $statements = [];

        // Each type of command has a corresponding compiler function on the schema
        // grammar which is used to build the necessary SQL statements to build
        // the blueprint element, so we'll just call that compilers function.
        foreach ($this->commands as $command) {
            $method = 'compile' . ucfirst($command->name);

            if (method_exists($grammar, $method)) {
                if (!is_null($sql = $grammar->{$method}($this, $command, $connection))) {
                    $statements = array_merge($statements, (array) $sql);
                }
            }
        }

        return $statements;
    }
public function toSql(Connection $connection, Grammar $grammar)
    {
        $this->addImpliedCommands();

        $statements = [];

        // Each type of command has a corresponding compiler function on the schema
        // grammar which is used to build the necessary SQL statements to build
        // the blueprint element, so we'll just call that compilers function.
        foreach ($this->commands as $command) {
            $method = 'compile' . ucfirst($command->name);

            if (method_exists($grammar, $method)) {
                if (!is_null($sql = $grammar->{$method}($this, $command, $connection))) {
                    $statements = array_merge($statements, (array) $sql);
                }
            }
        }

        return $statements;
    }
public function toSql ( Connection $ connection , Grammar $ grammar ) { $ this -> addImpliedCommands ( ) ; $ statements = [ ] ; // Each type of command has a corresponding compiler function on the schema // grammar which is used to build the necessary SQL statements to build // the blueprint element, so we'll just call that compilers function. foreach ( $ this -> commands as $ command ) { $ method = 'compile' . ucfirst ( $ command -> name ) ; if ( method_exists ( $ grammar , $ method ) ) { if ( ! is_null ( $ sql = $ grammar -> { $ method } ( $ this , $ command , $ connection ) ) ) { $ statements = array_merge ( $ statements , ( array ) $ sql ) ; } } } return $ statements ; }
Get the raw SQL statements for the blueprint.

@param \Mellivora\Database\Connection              $connection
@param \Mellivora\Database\Schema\Grammars\Grammar $grammar

@return array
Get the raw SQL statements for the blueprint .