public function update(StoreClientSurveyPuls $request, ClientSurvey $id): RedirectResponse 	{ 		$previous_status = $id->status; 		$previous_survey = $id->survey_id; 		$online_count = $request->online_applicants_count ?? 0; 		$offline_count = $request->offline_applicants_count ?? 0;  		$id->update([ 			'title' => $request->title, 			'client_id' => $request->client_id, 			'survey_id' => $request->survey_id, 			'start_date' => $request->start_date ? formatTimestamp($request->start_date, 'Y-m-d H:i', $request->user()->timezone) : null, 			'end_date' => $request->end_date ? formatTimestamp($request->end_date, 'Y-m-d H:i', $request->user()->timezone) : null, 			'invitation_date' => $request->invitation_date ? formatTimestamp($request->invitation_date, 'Y-m-d H:i', $request->user()->timezone) : null, 			'reminder_date' => $request->reminder_date ? formatTimestamp($request->reminder_date, 'Y-m-d H:i', $request->user()->timezone) : null, 			'number_of_employees' => $online_count + $offline_count, 			'online_applicants_count' => $online_count, 			'offline_applicants_count' => $offline_count, 			'multiple_access_codes' => $request->boolean('multiple_access_codes'), 			'include_demographic_questions' => $request->boolean('include_demographic_questions'), 			'company_size' => $request->company_size ?? $id->client->company_size, 			'locations' => $request->locations, 			'departments' => $request->departments, 			'paid' => $request->boolean('paid'), 			'relevant' => $request->boolean('relevant'), 			'draft' => $request->enum('status', ClientSurveyStatus::class) == ClientSurveyStatus::Created, 			'display_report' => $request->boolean('display_report'), 			'comparable' => $request->boolean('comparable'), 			'filter' => $request->boolean('filter'), 			'switch_basic_and_additional_question_order' => $request->boolean('switch_basic_and_additional_question_order'), 			'client_comment' => $request->client_comment, 			'admin_comment' => $request->admin_comment, 			'status' => $request->enum('status', ClientSurveyStatus::class) ?? ClientSurveyStatus::Created->value, 			'send_codes_via_email' => $request->boolean('send_codes_via_email'), 			'location_answer_required' => $request->boolean('location_answer_required'), 			'department_answer_required' => $request->boolean('department_answer_required'), 			'locations_description' => [ 				'en' => $request->locations_description_en ?? $id->getTranslation('locations_description', 'en'), 				'hr' => $request->locations_description_hr ?? $id->getTranslation('locations_description', 'hr'), 				'bs' => $request->locations_description_bs ?? $id->getTranslation('locations_description', 'bs'), 				'mk' => $request->locations_description_mk ?? $id->getTranslation('locations_description', 'mk'), 				'sl' => $request->locations_description_sl ?? $id->getTranslation('locations_description', 'sl'), 				'sr' => $request->locations_description_sr ?? $id->getTranslation('locations_description', 'sr'), 				'fr' => $request->locations_description_fr ?? $id->getTranslation('locations_description', 'fr'), 				'de' => $request->locations_description_de ?? $id->getTranslation('locations_description', 'de'), 			], 			'departments_description' => [ 				'en' => $request->departments_description_en ?? $id->getTranslation('departments_description', 'en'), 				'hr' => $request->departments_description_hr ?? $id->getTranslation('departments_description', 'hr'), 				'bs' => $request->departments_description_bs ?? $id->getTranslation('departments_description', 'bs'), 				'mk' => $request->departments_description_mk ?? $id->getTranslation('departments_description', 'mk'), 				'sl' => $request->departments_description_sl ?? $id->getTranslation('departments_description', 'sl'), 				'sr' => $request->departments_description_sr ?? $id->getTranslation('departments_description', 'sr'), 				'fr' => $request->departments_description_fr ?? $id->getTranslation('departments_description', 'fr'), 				'de' => $request->departments_description_de ?? $id->getTranslation('departments_description', 'de'), 			], 			'demographic_answers_required' => $request->boolean('demographic_answers_required'), 			'demographic_first' => $request->boolean('demographic_first'), 			'departments_first' => $request->boolean('departments_first'), 			'locations_first' => $request->boolean('locations_first'), 		]);  		if ($id->didSurveyChange($previous_survey)) { 			$id->clientSurveyPulsQuestions()->delete(); 		}  		$id->generateApplicants($request->emails, $request->offline_applicants_count);  		$client_survey_service = new ClientSurveyService; 		$client_survey_service->handlePulsQuestions($request, $id); 		$client_survey_service->handleLocationsAndDepartmentDeletion($request, $id); 		$client_survey_service->handleLocationsAndDepartmentCreation($request, $id); 		$client_survey_service->handleLocationsAndDepartmentUpdate($request, $id); 		$client_survey_service->handleDemographicQuestions($request, $id); 		$client_survey_service->handleQuestionScrambling($id);  		if (!$request->company_size) { 			$client_survey_service->setClientSurveyCompanySize($id); 		}  		// Schedule webhooks | Won't schedule if testing 		$client_survey_notification_service = new ClientSurveyNotificationService; 		$client_survey_notification_service->handleWebhooks($id);  		$izz_survey_notification_service = new IzzSurveyReminderForPulsNotificationService; 		$izz_survey_notification_service->handleWebhooks($id);  		// Handle status changed notifications 		if ($id->didStatusChange($previous_status)) { 			$client_survey_notification_service->handleStatusNotifications($id); 		}  		return $this->redirectFromSave('client-surveys-puls.list'); 	}