class Book extends Model
{
use OpenSearch\ScoutDriverPlus\Searchable;
public function searchableRouting()
{
return $this->user->id;
}
}
class Book extends Model
{
use OpenSearch\ScoutDriverPlus\Searchable;
public function toSearchableArray()
{
return [
'title' => $this->title,
'price' => $this->price,
'author' => $this->author->only(['name', 'phone_number']),
];
}
}
class Book extends Model
{
use OpenSearch\ScoutDriverPlus\Searchable;
public function toSearchableArray()
{
return [
'title' => $this->title,
'price' => $this->price,
'author' => $this->author->only(['name', 'phone_number']),
];
}
public function searchableWith()
{
return ['author'];
}
}
class Book extends Model
{
use OpenSearch\ScoutDriverPlus\Searchable;
public function searchableConnection(): ?string
{
return 'books';
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.