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