/** * @test */ public function it_adds_a_object_map() { $blueprint = new Blueprint('post'); $blueprint->create(); $blueprint->object('tags', function ($blueprint) { $blueprint->string('name'); }); $statement = $blueprint->toDSL($this->getGrammar()); $this->assertEquals(['tags' => ['properties' => ['name' => ['type' => 'string']]]], $statement); }
/** * Create a map body. * * @param Blueprint $blueprint * @param Fluent $command * * @return array */ public function compileCreate(Blueprint $blueprint, Fluent $command) { $fields = $blueprint->getFields(); $statement = $this->compileFields($fields); return $statement; }
/** * Execute the blueprint to build. * * @param Blueprint $blueprint */ protected function build(Blueprint $blueprint) { $blueprint->build($this->connection, $this->grammar); }