public function toArray($request): array 	{ 		$applicants = $this->applicants; 		$lang = $request->lang ?? DomainLanguages::getDefaultLanguage();  		return [ 			'id' => $this->getKey(), 			'survey_year' => $this->survey->year, 			'client_id' => $this->client_id, 			'survey_id' => $this->survey_id, 			'survey_type' => $this->survey_type, 			'start_date' => $this->start_date ? formatTimestamp($this->start_date, 'Y-m-d H:i') : null, 			'end_date' => $this->end_date ? formatTimestamp($this->end_date, 'Y-m-d H:i') : null, 			'invitation_date' => $this->invitation_date ? formatTimestamp($this->invitation_date, 'Y-m-d H:i') : null, 			'reminder_date' => $this->reminder_date ? formatTimestamp($this->reminder_date, 'Y-m-d H:i') : null, 			'number_of_employees' => $this->number_of_employees, 			'number_of_male_employees' => $this->number_of_male_employees, 			'number_of_female_employees' => $this->number_of_female_employees, 			'number_of_other_employees' => $this->number_of_other_employees, 			'number_of_employees_with_special_qualification' => $this->number_of_employees_with_special_qualification, 			'number_of_employees_with_higher_qualification' => $this->number_of_employees_with_higher_qualification, 			'number_of_employees_with_middle_qualification' => $this->number_of_employees_with_middle_qualification, 			'number_of_employees_with_lower_qualification' => $this->number_of_employees_with_lower_qualification, 			'online_applicants_count' => $this->online_applicants_count, 			'offline_applicants_count' => $this->offline_applicants_count, 			'emails' => $this->applicants->pluck('email'), 			'email_languages' => $this->applicants->map(function ($applicant) { 				return [$applicant->email => $applicant->default_language]; 			})->flatMap(function (array $values) { 				return $values; 			}), 			'type' => $this->type, 			'multiple_access_codes' => $this->multiple_access_codes, 			'include_demographic_questions' => $this->include_demographic_questions, 			'company_size' => $this->company_size, 			'locations' => LocationResourceWithTranslations::collection($this->locations), 			'locations_description' => $this->getTranslations('locations_description'), 			'location_answer_required' => $this->location_answer_required, 			'departments' => DepartmentResourceWithTranslations::collection($this->departments), 			'departments_description' => $this->getTranslations('departments_description'), 			'department_answer_required' => $this->department_answer_required, 			'paid' => $this->paid, 			'relevant' => $this->relevant, 			'draft' => $this->draft, 			'completed_survey_count' => $applicants->where('filled', true)->count(), 			'total_survey_count' => $applicants->count(), 			'switch_basic_and_additional_question_order' => $this->switch_basic_and_additional_question_order, 			'additional_questions' => QuestionResourceWithTranslations::collection($this->extraQuestions), 			'demographic_questions' => QuestionResourceWithTranslations::collection($this->demographicQuestions), 			'status' => $this->status->value, 			'overall_grade' => $this->getStyledOverallGradeString(), 			'send_codes_via_email' => $this->send_codes_via_email, 			'demographic_answers_required' => $this->demographic_answers_required, 			'demographic_first' => $this->demographic_first, 			'departments_first' => $this->departments_first, 			'locations_first' => $this->locations_first, 		]; 	}