public function toArray($request): array 	{ 		$applicants = $this->applicants; 		$lang = $request->lang ?? DomainLanguages::getDefaultLanguage();  		return [ 			'id' => $this->getKey(), 			'title' => $this->title, 			'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, 			'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, 			'main_questions' => QuestionResourceWithTranslations::collection($this->pulsQuestions), 			'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, 		]; 	}