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