/** * Execute the console command. */ public function fire() { $contracts = $this->contract->all(); foreach ($contracts as $contract) { if ($contract->metadata_status == "published") { $this->elastic->postMetadata($contract->id); $this->info(sprintf('Contract %s : Metadata Indexed.', $contract->id)); } if ($contract->text_status == "published") { $this->elastic->postText($contract->id); $this->info(sprintf('Contract %s : Text Indexed.', $contract->id)); } if ($this->annotations->getStatus($contract->id) == "published") { $this->elastic->postAnnotation($contract->id); $this->info(sprintf('Contract %s : Annotations Indexed.', $contract->id)); } } }