Defining Searchable Attributes
- Posted March 29, 2017
- Developer Tools
Introduction
By default all entry fields are searchable. You can override this on your custom models or by binding your own model to a core one and overriding the toSearchableArray
method.
Basic Usage
To get started open your model class and add a public toSearchableArray
method that returns an associated array of searchable data:
public function toSearchableArray()
{
return [
'title' => $this->title,
'content' => $this->content(),
];
}