public function transform($relations = false)
    {
        $relations = $relations ? Config::get('larasearch.paths.' . get_class($this)) : [];

        $doc = $this->load($relations)->toArray();

        return $doc;
    }
public function transform($relations = false)
    {
        $relations = $relations ? Config::get('larasearch.paths.' . get_class($this)) : [];

        $doc = $this->load($relations)->toArray();

        return $doc;
    }
public function transform ( $ relations = false ) { $ relations = $ relations ? Config :: get ( 'larasearch.paths.' . get_class ( $ this ) ) : [ ] ; $ doc = $ this -> load ( $ relations ) -> toArray ( ) ; return $ doc ; }
Transform the Person model and its relations to an Elasticsearch document.

@param bool $relations
@return array
Transform the Person model and its relations to an Elasticsearch document .