@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | $this->authorize('update', $application); |
160 | 160 | |
161 | 161 | $criteria = [ |
162 | - 'essential' => $jobPoster->criteria->filter(function ($value, $key) { |
|
162 | + 'essential' => $jobPoster->criteria->filter(function($value, $key){ |
|
163 | 163 | return $value->criteria_type->name == 'essential'; |
164 | 164 | }), |
165 | - 'asset' => $jobPoster->criteria->filter(function ($value, $key) { |
|
165 | + 'asset' => $jobPoster->criteria->filter(function($value, $key){ |
|
166 | 166 | return $value->criteria_type->name == 'asset'; |
167 | 167 | }), |
168 | 168 | ]; |
@@ -204,10 +204,10 @@ discard block |
||
204 | 204 | $this->authorize('update', $application); |
205 | 205 | |
206 | 206 | $criteria = [ |
207 | - 'essential' => $jobPoster->criteria->filter(function ($value, $key) { |
|
207 | + 'essential' => $jobPoster->criteria->filter(function($value, $key){ |
|
208 | 208 | return $value->criteria_type->name == 'essential'; |
209 | 209 | }), |
210 | - 'asset' => $jobPoster->criteria->filter(function ($value, $key) { |
|
210 | + 'asset' => $jobPoster->criteria->filter(function($value, $key){ |
|
211 | 211 | return $value->criteria_type->name == 'asset'; |
212 | 212 | }), |
213 | 213 | ]; |
@@ -246,10 +246,10 @@ discard block |
||
246 | 246 | |
247 | 247 | $this->authorize('view', $application); |
248 | 248 | $criteria = [ |
249 | - 'essential' => $jobPoster->criteria->filter(function ($value, $key) { |
|
249 | + 'essential' => $jobPoster->criteria->filter(function($value, $key){ |
|
250 | 250 | return $value->criteria_type->name == 'essential'; |
251 | 251 | }), |
252 | - 'asset' => $jobPoster->criteria->filter(function ($value, $key) { |
|
252 | + 'asset' => $jobPoster->criteria->filter(function($value, $key){ |
|
253 | 253 | return $value->criteria_type->name == 'asset'; |
254 | 254 | }), |
255 | 255 | ]; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | */ |
32 | 32 | public function passes($attribute, $value) |
33 | 33 | { |
34 | - return $value->contains(function ($object) { |
|
34 | + return $value->contains(function($object){ |
|
35 | 35 | $object->getRelationValue($this->relationName)->is($this->relationValue); |
36 | 36 | }); |
37 | 37 | } |
@@ -25,11 +25,11 @@ |
||
25 | 25 | Validator::make($workSamplesValidator->getAttributes(), [ |
26 | 26 | 'applicant_id' => [ |
27 | 27 | 'required', |
28 | - Rule::in($applicant_ids->toArray()), |
|
28 | + Rule::in($applicant_ids->toArray()), |
|
29 | 29 | ], |
30 | 30 | 'file_type_id' => [ |
31 | 31 | 'required', |
32 | - Rule::in($this->file_type_id->toArray()), |
|
32 | + Rule::in($this->file_type_id->toArray()), |
|
33 | 33 | ] |
34 | 34 | |
35 | 35 | ])->validate(); |
@@ -19,12 +19,12 @@ |
||
19 | 19 | * https://laraveldaily.com/how-to-create-custom-validation-rules-laravel/ |
20 | 20 | */ |
21 | 21 | |
22 | - public function passes($attribute, $value) { |
|
22 | + public function passes($attribute, $value){ |
|
23 | 23 | $passwordPattern = "~^.*(?=.{3,})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[.!@#$%^&*]).*$~"; |
24 | 24 | return preg_match($passwordPattern, $value); |
25 | 25 | } |
26 | 26 | |
27 | - public function message() { |
|
27 | + public function message(){ |
|
28 | 28 | return Lang::get('validation.custom.password'); |
29 | 29 | } |
30 | 30 |
@@ -27,11 +27,11 @@ |
||
27 | 27 | Validator::make($degreeValidator->getAttributes(), [ |
28 | 28 | 'applicant_id' => [ |
29 | 29 | 'required', |
30 | - Rule::in($applicant_ids->toArray()), |
|
30 | + Rule::in($applicant_ids->toArray()), |
|
31 | 31 | ], |
32 | 32 | 'degree_type_id' => [ |
33 | 33 | 'required', |
34 | - Rule::in($this->degree_type_id->toArray()), |
|
34 | + Rule::in($this->degree_type_id->toArray()), |
|
35 | 35 | ] |
36 | 36 | |
37 | 37 | ])->validate(); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | // debugbar()->debug($value); |
47 | 47 | // debugbar()->debug($this->attributeName); |
48 | 48 | // debugbar()->debug($this->attributeValue); |
49 | - return $this->array_any($value, function ($object) { |
|
49 | + return $this->array_any($value, function($object){ |
|
50 | 50 | return $object[$this->attributeName] == $this->attributeValue; |
51 | 51 | }); |
52 | 52 | } |
@@ -25,13 +25,13 @@ |
||
25 | 25 | //Validate basic data is filled in |
26 | 26 | Validator::make($courseValidator->getAttributes(), [ |
27 | 27 | 'applicant_id' => [ |
28 | - 'required', |
|
28 | + 'required', |
|
29 | 29 | Rule::in($applicant_ids->toArray()), |
30 | - ], |
|
31 | - 'course_status_id' => [ |
|
32 | - 'required', |
|
30 | + ], |
|
31 | + 'course_status_id' => [ |
|
32 | + 'required', |
|
33 | 33 | Rule::in($this->course_status_ids->toArray()), |
34 | - ] |
|
34 | + ] |
|
35 | 35 | |
36 | 36 | ])->validate(); |
37 | 37 | } |
@@ -7,17 +7,17 @@ discard block |
||
7 | 7 | use Illuminate\Support\Facades\Validator; |
8 | 8 | use Illuminate\Validation\Rule; |
9 | 9 | |
10 | -class JobApplicationAnswerValidator { |
|
10 | +class JobApplicationAnswerValidator{ |
|
11 | 11 | |
12 | 12 | protected $application; |
13 | 13 | protected $questionIds; |
14 | 14 | |
15 | - public function __construct(JobApplication $application) { |
|
15 | + public function __construct(JobApplication $application){ |
|
16 | 16 | $this->application = $application; |
17 | 17 | $this->questionIds = $application->job_poster->job_poster_questions->pluck('id')->toArray(); |
18 | 18 | } |
19 | 19 | |
20 | - public function rules() { |
|
20 | + public function rules(){ |
|
21 | 21 | $rules = [ |
22 | 22 | 'answer' => 'required|string', |
23 | 23 | 'job_poster_question_id' => [ |
@@ -32,17 +32,17 @@ discard block |
||
32 | 32 | return $rules; |
33 | 33 | } |
34 | 34 | |
35 | - public function validator(JobApplicationAnswer $answer) { |
|
35 | + public function validator(JobApplicationAnswer $answer){ |
|
36 | 36 | |
37 | 37 | |
38 | 38 | return Validator::make($answer->toArray(), $this->rules()); |
39 | 39 | } |
40 | 40 | |
41 | - public function validate(JobApplicationAnswer $answer) { |
|
41 | + public function validate(JobApplicationAnswer $answer){ |
|
42 | 42 | return $this->validator($answer)->validate(); |
43 | 43 | } |
44 | 44 | |
45 | - public function isComplete(JobApplicationAnswer $answer) { |
|
45 | + public function isComplete(JobApplicationAnswer $answer){ |
|
46 | 46 | return $this->validator($answer)->passes(); |
47 | 47 | } |
48 | 48 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | ]; |
22 | 22 | } |
23 | 23 | |
24 | - public function messages() { |
|
24 | + public function messages(){ |
|
25 | 25 | return Lang::get('validation.custom.password'); |
26 | 26 | } |
27 | 27 | } |