Sleimanx2\Plastic\Map\Blueprint::date PHP Метод

date() публичный Метод

Add a date field to the map.
public date ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
Результат Illuminate\Support\Fluent
    public function date($field, $attributes = [])
    {
        return $this->addField('date', $field, $attributes);
    }

Usage Example

Пример #1
0
 /**
  * @test
  */
 public function it_adds_a_date_map()
 {
     $blueprint = new Blueprint('post');
     $blueprint->create();
     $blueprint->date('created_at');
     $statement = $blueprint->toDSL($this->getGrammar());
     $this->assertEquals(['created_at' => ['type' => 'date']], $statement);
 }