createsDocument = $createsDocument; $this->updatesCompanyStatus = $updatesCompanyStatus; $this->createsFiles = $createsFiles; } /** * @param Request $request * @param Company $company * @throws \App\Classes\Exceptions\MalformedRequestException */ public function execute(Request $request, Company $company) { $object = new DocumentObject($company->type === CompanyType::COMPANY_BUSINESS ? DocumentType::SSM_REGISTRATION : DocumentType::IDENTITY_CARD, $request->input('files'), $request->input('identification_no'), ApprovalStatus::PENDING_VERIFICATION, 'identifications'); /** @var Document $document */ $document = $this->createsDocument->execute($company, $object); $this->createsFiles->execute($document, $object); $this->updatesCompanyStatus->execute($company, ApprovalStatus::PENDING_VERIFICATION); } }