createCompanyProcessor = $createCompanyProcessor; $this->createCompanyModuleProcessor = $createCompanyModuleProcessor; $this->createUnityEntityProcessor = $createUnityEntityProcessor; } /** * @return array */ protected function notification():array { return [ 'title' => 'Created Company', 'message' => 'You have successfully created a new Company' ]; } /** @var CreateCompanyProcessor */ private $createCompanyProcessor; /** * @param Request $request * @return JsonResponse * @throws \App\Classes\Exceptions\AccessForbiddenException * @throws \App\Classes\Exceptions\MalformedRequestException * @throws \App\Classes\Exceptions\RequestValidationException */ public function logic(Request $request) : JsonResponse { $company = $this->createCompanyProcessor->execute($request, $request->input('type'), ApprovalStatus::PENDING_SUBMISSION); $this->createCompanyModuleProcessor->execute($company , $request->input('business_type')); return $this->resourceResponse(new CompanyResource($company)); } }