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

boolean() public method

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

Usage Example

Example #1
0
 /**
  * @test
  */
 public function it_adds_a_boolean_map()
 {
     $blueprint = new Blueprint('post');
     $blueprint->create();
     $blueprint->boolean('deleted');
     $statement = $blueprint->toDSL($this->getGrammar());
     $this->assertEquals(['deleted' => ['type' => 'boolean']], $statement);
 }