Nwidart\Modules\Support\Migrations\SchemaParser::render PHP Method

render() public method

Render the migration to formatted script.
public render ( ) : string
return string
    public function render()
    {
        $results = '';
        foreach ($this->toArray() as $column => $attributes) {
            $results .= $this->createField($column, $attributes);
        }
        return $results;
    }

Usage Example

Ejemplo n.º 1
0
    /** @test */
    public function it_generates_migration_method_calls()
    {
        $parser = new SchemaParser('username:string, password:integer');
        $expected = <<<TEXT
\t\t\t\$table->string('username');
\t\t\t\$table->integer('password');

TEXT;
        self::assertEquals($expected, $parser->render());
    }