'datetime:Y-m-d' ]; public function authors() { return $this->belongsToMany(Author::class, 'book_authors'); } public function location() { return $this->belongsTo(Location::class); } protected $mapping = [ 'properties' => [ 'name' => [ 'type' => 'text', 'fields' => [ 'raw' => [ 'type' => 'keyword', ] ] ], 'description' => [ 'type' => 'text', 'fields' => [ 'raw' => [ 'type' => 'keyword', ] ] ], 'published_date' => [ 'type' => 'date', 'format' => 'yyyy-MM-dd' ] ] ]; }