Implement ProviderInterface to supply objects for the populate command.
final class ProductProvider implements ProviderInterface
{
public function provide(IndexDefinition $index, int $batchSize): iterable
{
yield from $this->repository->iterateForSearch();
}
}
Register the provider and reference it from your index configuration.
How can I help you explore Laravel packages today?