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

ip() public method

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

Usage Example

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