What's the best way to make sure Scout index is being updated after changing tags? #505
Unanswered
aaronaccessvr
asked this question in
Q&A
Replies: 1 comment
-
In order to move forward, I have decided on a solution like this: class MyModel extends Model {
use HasTags {
syncTagIds as protected syncTagIdsTrait;
}
protected function syncTagIds($ids, string | null $type = null, $detaching = true): void
{
$this->syncTagIdsTrait($ids, $type, $detaching);
$this->unsetRelation('tags');
if ($this->shouldBeSearchable()) {
$this->searchable();
}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using Laravel Nova but I also have a few other background jobs that change the tags that are attached to my models. How do I go about ensuring that Laravel Scout's index is being updated anytime tags are attached/detached from my models?
Beta Was this translation helpful? Give feedback.
All reactions