Created
September 15, 2016 19:57
-
-
Save markbiek/a46784508dca46519ef92a4b38bab13a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person extends Model { | |
use AlgoliaEloquentTrait; | |
public $indices = [‘my-index’]; | |
public function getAlgoliaRecord() { | |
return array_merge($this->toArray(), [ | |
‘addresses’ => $this->addresses->toArray(), | |
‘contacts’ => $this->contacts->toArray() | |
]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment