*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'user_id' => $this->user_id, 'user_kyc' => Profile::where('user_id', $this->user_id)->first()->kyc, 'name' => $this->name, 'description' => $this->description, 'accommodation' => $this->accommodation, 'working_days' => $this->working_days, 'working_hours' => $this->working_hours, 'image' => $this->image, 'salary' => $this->salary, 'address' => $this->address, 'location' => $this->location, 'recommended_age' => $this->recomended_age, 'skills' => $this->getFormattedSkillsAttribute(), 'parameters' => $this->getFormattedParametersAttribute(), 'applicant' => Applicant::where('job_id', $this->id)->count(), 'applicants' => $this->getFormattedApplicantAttribute(), 'recruit_id' => $this->recruit_id, ]; } }