Scout Version
10.1.0
Scout Driver
Typesense
Laravel Version
9
PHP Version
8.1
Database Driver & Version
No response
SDK Version
No response
Meilisearch CLI Version
No response
Description
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.