delete(); $types = $entityProvider->all(); foreach ($types as $type => $typeInstance) { $this->info("Creating jobs to store vectors for {$type} data..."); /** @var Entity[] $entities */ $typeInstance->newQuery()->chunkById(100, function ($entities) { foreach ($entities as $entity) { dispatch(new StoreEntityVectorsJob($entity)); } }); } } }