| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function validate(WorkExperienceValidator $workExperienceValidator) |
||
| 22 | { |
||
| 23 | $uniqueSkillRule = new UniqueApplicantSkillRule($this->applicant, $workExperienceValidator->id); |
||
| 24 | //This array is reset every time because applicants table can change frequently |
||
| 25 | $applicant_ids = Applicant::all()->pluck('id'); |
||
| 26 | //Validate basic data is filled in |
||
| 27 | Validator::make($workExperienceValidator->getAttributes(), [ |
||
| 28 | 'applicant_id' => [ |
||
| 29 | 'required', |
||
| 30 | Rule::in($applicant_ids->toArray()), |
||
| 31 | ] |
||
| 32 | |||
| 33 | ])->validate(); |
||
| 34 | } |
||
| 36 | } |