Skip to content

Instantly share code, notes, and snippets.

@markbiek
Created September 15, 2016 19:57
Show Gist options
  • Save markbiek/a46784508dca46519ef92a4b38bab13a to your computer and use it in GitHub Desktop.
Save markbiek/a46784508dca46519ef92a4b38bab13a to your computer and use it in GitHub Desktop.
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