You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Laravel Scout is syncing all User model records even though the shouldBeSearchable() method is defined to filter them. The method is being ignored because searchable() is called on the full collection (User::all()), which bypasses the shouldBeSearchable() logic.
Steps To Reproduce
Define a shouldBeSearchable() method in your model (e.g., User):
public function shouldBeSearchable()
{
return $this->is_active;
}
Run this code to sync the models:
User::all()->searchable();
Observe that all users are indexed, including those where is_active = false.