Sleimanx2\Plastic\Map\Blueprint::shape PHP Method

shape() public method

Add a geo shape field to the map.
public shape ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
return Illuminate\Support\Fluent
    public function shape($field, $attributes = [])
    {
        return $this->addField('shape', $field, $attributes);
    }

Usage Example

Esempio n. 1
0
 /**
  * @test
  */
 public function it_adds_a_geo_shape_map()
 {
     $blueprint = new Blueprint('post');
     $blueprint->create();
     $blueprint->shape('area');
     $statement = $blueprint->toDSL($this->getGrammar());
     $this->assertEquals(['area' => ['type' => 'geo_shape']], $statement);
 }