approvePurchaseOrderProcessor = $approvePurchaseOrderProcessor; } /** * @return */ public function execute($questionMetadata, $answerOptionId){ $answerOption = QAAnswerOptions::where('id', $answerOptionId)->first(); if($answerOption && $answerOption->value === "approve_po_approved"){ $this->approvePurchaseOrderProcessor->execute($questionMetadata['id']); } } }