@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @property \App\Models\Applicant $applicant |
21 | 21 | * @property \App\Models\Lookup\ApplicantProfileQuestion $applicant_profile_question |
22 | 22 | */ |
23 | -class ApplicantProfileAnswer extends BaseModel { |
|
23 | +class ApplicantProfileAnswer extends BaseModel{ |
|
24 | 24 | |
25 | 25 | protected $casts = [ |
26 | 26 | 'applicant_id' => 'int', |
@@ -34,12 +34,12 @@ discard block |
||
34 | 34 | 'applicant_profile_question' |
35 | 35 | ]; |
36 | 36 | |
37 | - public function applicant() { |
|
38 | - return $this->belongsTo(\App\Models\Applicant::class); |
|
37 | + public function applicant(){ |
|
38 | + return $this->belongsTo (\App\Models\Applicant::class); |
|
39 | 39 | } |
40 | 40 | |
41 | - public function applicant_profile_question() { |
|
42 | - return $this->belongsTo(\App\Models\Lookup\ApplicantProfileQuestion::class); |
|
41 | + public function applicant_profile_question(){ |
|
42 | + return $this->belongsTo (\App\Models\Lookup\ApplicantProfileQuestion::class); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @property \App\Models\JobApplication $job_application |
21 | 21 | * @property \App\Models\JobPosterQuestion $job_poster_question |
22 | 22 | */ |
23 | -class JobApplicationAnswer extends BaseModel { |
|
23 | +class JobApplicationAnswer extends BaseModel{ |
|
24 | 24 | |
25 | 25 | protected $casts = [ |
26 | 26 | 'job_poster_questions_id' => 'int', |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | 'answer' |
31 | 31 | ]; |
32 | 32 | |
33 | - public function job_application() { |
|
34 | - return $this->belongsTo(\App\Models\JobApplication::class); |
|
33 | + public function job_application(){ |
|
34 | + return $this->belongsTo (\App\Models\JobApplication::class); |
|
35 | 35 | } |
36 | 36 | |
37 | - public function job_poster_question() { |
|
38 | - return $this->belongsTo(\App\Models\JobPosterQuestion::class); |
|
37 | + public function job_poster_question(){ |
|
38 | + return $this->belongsTo (\App\Models\JobPosterQuestion::class); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @property \App\Models\WorkEnvironment $work_environment |
22 | 22 | * @property \App\Models\WorkplacePhoto $workplace_photo |
23 | 23 | */ |
24 | -class WorkplacePhotoCaption extends BaseModel { |
|
24 | +class WorkplacePhotoCaption extends BaseModel{ |
|
25 | 25 | |
26 | 26 | protected $casts = [ |
27 | 27 | 'work_environment_id' => 'int', |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | 'description' |
33 | 33 | ]; |
34 | 34 | |
35 | - public function work_environment() { |
|
36 | - return $this->belongsTo(\App\Models\WorkEnvironment::class); |
|
35 | + public function work_environment(){ |
|
36 | + return $this->belongsTo (\App\Models\WorkEnvironment::class); |
|
37 | 37 | } |
38 | 38 | |
39 | - public function workplace_photo() { |
|
40 | - return $this->belongsTo(\App\Models\WorkplacePhoto::class); |
|
39 | + public function workplace_photo(){ |
|
40 | + return $this->belongsTo (\App\Models\WorkplacePhoto::class); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | } |
@@ -13,19 +13,19 @@ discard block |
||
13 | 13 | use App\Services\Validation\Rules\ContainsObjectWithAttributeRule; |
14 | 14 | use App\Services\Validation\JobApplicationAnswerValidator; |
15 | 15 | |
16 | -class ApplicationValidator { |
|
16 | +class ApplicationValidator{ |
|
17 | 17 | |
18 | 18 | protected $citizenship_ids; |
19 | 19 | protected $veteran_status_ids; |
20 | 20 | protected $preferred_language_ids; |
21 | 21 | |
22 | - public function __construct() { |
|
23 | - $this->citizenship_ids = CitizenshipDeclaration::all()->pluck('id')->toArray(); |
|
24 | - $this->veteran_status_ids = VeteranStatus::all()->pluck('id')->toArray(); |
|
25 | - $this->preferred_language_ids = PreferredLanguage::all()->pluck('id')->toArray(); |
|
22 | + public function __construct(){ |
|
23 | + $this->citizenship_ids = CitizenshipDeclaration::all ()->pluck ('id')->toArray (); |
|
24 | + $this->veteran_status_ids = VeteranStatus::all ()->pluck ('id')->toArray (); |
|
25 | + $this->preferred_language_ids = PreferredLanguage::all ()->pluck ('id')->toArray (); |
|
26 | 26 | } |
27 | 27 | |
28 | - public function validate(JobApplication $application) { |
|
28 | + public function validate(JobApplication $application){ |
|
29 | 29 | |
30 | 30 | $backendRules = [ |
31 | 31 | 'job_poster_id' => 'required', |
@@ -33,30 +33,30 @@ discard block |
||
33 | 33 | 'applicant_id' => 'required' |
34 | 34 | ]; |
35 | 35 | |
36 | - $rules = array_merge( |
|
36 | + $rules = array_merge ( |
|
37 | 37 | $backendRules, |
38 | 38 | //$this->basicsValidator($application)->getRules(), |
39 | - $this->experienceValidator($application)->getRules(), |
|
39 | + $this->experienceValidator ($application)->getRules (), |
|
40 | 40 | //$this->essentialSkillsValidator($application)->getRules(), |
41 | - $this->affirmationValidator($application)->getRules() |
|
41 | + $this->affirmationValidator ($application)->getRules () |
|
42 | 42 | ); |
43 | 43 | |
44 | - $data = $application->toArray(); |
|
44 | + $data = $application->toArray (); |
|
45 | 45 | |
46 | 46 | // Combining and simplifiying error messages |
47 | - $rules = array_merge( |
|
47 | + $rules = array_merge ( |
|
48 | 48 | $rules, |
49 | 49 | ['application_step_1' => 'required|boolean|accepted'], |
50 | 50 | ['application_step_3' => 'required|boolean|accepted'] |
51 | 51 | ); |
52 | - $data = array_merge( |
|
52 | + $data = array_merge ( |
|
53 | 53 | $data, |
54 | - ['application_step_1' => $this->basicsComplete($application)], |
|
55 | - ['application_step_3' => $this->essentialSkillsComplete($application)] |
|
54 | + ['application_step_1' => $this->basicsComplete ($application)], |
|
55 | + ['application_step_3' => $this->essentialSkillsComplete ($application)] |
|
56 | 56 | ); |
57 | 57 | |
58 | 58 | //Validate basic data is filled in |
59 | - Validator::make($data, $rules)->validate(); |
|
59 | + Validator::make ($data, $rules)->validate (); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -70,110 +70,110 @@ discard block |
||
70 | 70 | { |
71 | 71 | $newArray = []; |
72 | 72 | foreach ($array as $key => $value) { |
73 | - $newArray[$fn($key)] = $value; |
|
73 | + $newArray[$fn ($key)] = $value; |
|
74 | 74 | } |
75 | 75 | return $newArray; |
76 | 76 | } |
77 | 77 | |
78 | - protected function addNestedValidatorRules($nestedAttribute, $validatorRules, $rules = []) { |
|
78 | + protected function addNestedValidatorRules($nestedAttribute, $validatorRules, $rules = []){ |
|
79 | 79 | // prepend the attribute name of each validator rule with the nested attribute name |
80 | - $newRules = $this->arrayMapKeys(function($key) use ($nestedAttribute) { |
|
81 | - return implode('.', [$nestedAttribute, $key]); |
|
80 | + $newRules = $this->arrayMapKeys (function ($key) use ($nestedAttribute) { |
|
81 | + return implode ('.', [$nestedAttribute, $key]); |
|
82 | 82 | }, |
83 | 83 | $validatorRules); |
84 | 84 | //Merge new rules with old rules |
85 | - $rules = array_merge($rules, $newRules); |
|
85 | + $rules = array_merge ($rules, $newRules); |
|
86 | 86 | return $rules; |
87 | 87 | } |
88 | 88 | |
89 | - public function basicsValidator(JobApplication $application) { |
|
89 | + public function basicsValidator(JobApplication $application){ |
|
90 | 90 | // Validate the fields common to every application |
91 | 91 | $rules = [ |
92 | 92 | 'language_requirement_confirmed' => ['required', 'boolean'], |
93 | - 'citizenship_declaration_id' => ['required', Rule::in($this->citizenship_ids)], |
|
94 | - 'veteran_status_id' => ['required', Rule::in($this->veteran_status_ids)], |
|
95 | - 'preferred_language_id' => ['required', Rule::in($this->preferred_language_ids)], |
|
93 | + 'citizenship_declaration_id' => ['required', Rule::in ($this->citizenship_ids)], |
|
94 | + 'veteran_status_id' => ['required', Rule::in ($this->veteran_status_ids)], |
|
95 | + 'preferred_language_id' => ['required', Rule::in ($this->preferred_language_ids)], |
|
96 | 96 | ]; |
97 | 97 | |
98 | 98 | //Load application answers so they are included in application->toArray() |
99 | - $application->load('job_application_answers'); |
|
99 | + $application->load ('job_application_answers'); |
|
100 | 100 | |
101 | 101 | // Validate that each question has been answered |
102 | 102 | $jobPosterQuestionRules = []; |
103 | - foreach($application->job_poster->job_poster_questions as $question) { |
|
104 | - $jobPosterQuestionRules[] = new ContainsObjectWithAttributeRule('job_poster_question_id', $question->id); |
|
103 | + foreach ($application->job_poster->job_poster_questions as $question) { |
|
104 | + $jobPosterQuestionRules[] = new ContainsObjectWithAttributeRule ('job_poster_question_id', $question->id); |
|
105 | 105 | } |
106 | 106 | $rules['job_application_answers'] = $jobPosterQuestionRules; |
107 | - $answerValidatorFactory = new JobApplicationAnswerValidator($application); |
|
107 | + $answerValidatorFactory = new JobApplicationAnswerValidator ($application); |
|
108 | 108 | |
109 | 109 | //Validate that each answer is complete |
110 | - foreach($application->job_application_answers as $key=>$answer) { |
|
111 | - $attribute = implode('.', ['job_application_answers', $key]); |
|
112 | - $rules = $this->addNestedValidatorRules($attribute, $answerValidatorFactory->rules(), $rules); |
|
110 | + foreach ($application->job_application_answers as $key=>$answer) { |
|
111 | + $attribute = implode ('.', ['job_application_answers', $key]); |
|
112 | + $rules = $this->addNestedValidatorRules ($attribute, $answerValidatorFactory->rules (), $rules); |
|
113 | 113 | } |
114 | 114 | |
115 | - $validator = Validator::make($application->toArray(), $rules); |
|
115 | + $validator = Validator::make ($application->toArray (), $rules); |
|
116 | 116 | return $validator; |
117 | 117 | } |
118 | 118 | |
119 | - public function basicsComplete(JobApplication $application) { |
|
120 | - $validator = $this->basicsValidator($application); |
|
121 | - return $validator->passes(); |
|
119 | + public function basicsComplete(JobApplication $application){ |
|
120 | + $validator = $this->basicsValidator ($application); |
|
121 | + return $validator->passes (); |
|
122 | 122 | } |
123 | 123 | |
124 | - public function experienceValidator(JobApplication $application) { |
|
124 | + public function experienceValidator(JobApplication $application){ |
|
125 | 125 | $rules = ['experience_saved' => 'required|boolean|accepted']; |
126 | - return Validator::make($application->toArray(), $rules); |
|
126 | + return Validator::make ($application->toArray (), $rules); |
|
127 | 127 | } |
128 | 128 | |
129 | - public function experienceComplete(JobApplication $application) { |
|
130 | - return $this->experienceValidator($application)->passes(); |
|
129 | + public function experienceComplete(JobApplication $application){ |
|
130 | + return $this->experienceValidator ($application)->passes (); |
|
131 | 131 | } |
132 | 132 | |
133 | - protected function skillsValidator(JobApplication $application, $criteria_type) { |
|
133 | + protected function skillsValidator(JobApplication $application, $criteria_type){ |
|
134 | 134 | $rules = []; |
135 | 135 | |
136 | 136 | $skillDeclarationRules = []; |
137 | - $criteriaTypeId = CriteriaType::where('name', $criteria_type)->firstOrFail()->id; |
|
138 | - foreach($application->job_poster->criteria->where('criteria_type_id', $criteriaTypeId) as $criteria) { |
|
137 | + $criteriaTypeId = CriteriaType::where ('name', $criteria_type)->firstOrFail ()->id; |
|
138 | + foreach ($application->job_poster->criteria->where ('criteria_type_id', $criteriaTypeId) as $criteria) { |
|
139 | 139 | //Validate that every essential skill has a corresponding declaration |
140 | - $skillDeclarationRules[] = new ContainsObjectWithAttributeRule('skill_id', $criteria->skill_id); |
|
140 | + $skillDeclarationRules[] = new ContainsObjectWithAttributeRule ('skill_id', $criteria->skill_id); |
|
141 | 141 | } |
142 | 142 | $rules['skill_declarations'] = $skillDeclarationRules; |
143 | - $application->applicant->load('skill_declarations'); |
|
143 | + $application->applicant->load ('skill_declarations'); |
|
144 | 144 | |
145 | 145 | //Validate that those declarations are complete |
146 | - $skilDeclarationValidatorFactory = new SkillDeclarationValidator($application->applicant); |
|
147 | - $relevantSkillIds = $application->job_poster->criteria->where('criteria_type_id', $criteriaTypeId)->pluck('skill_id'); |
|
148 | - foreach( $application->skill_declarations as $key=>$declaration) { |
|
149 | - if ($relevantSkillIds->contains($declaration->skill_id)) { |
|
150 | - $attribute = implode('.', ['skill_declarations', $key]); |
|
151 | - $skillDeclarationValidator = $skilDeclarationValidatorFactory->validator($declaration); |
|
152 | - $rules = $this->addNestedValidatorRules($attribute, $skillDeclarationValidator->getRules(), $rules); |
|
146 | + $skilDeclarationValidatorFactory = new SkillDeclarationValidator ($application->applicant); |
|
147 | + $relevantSkillIds = $application->job_poster->criteria->where ('criteria_type_id', $criteriaTypeId)->pluck ('skill_id'); |
|
148 | + foreach ($application->skill_declarations as $key=>$declaration) { |
|
149 | + if ($relevantSkillIds->contains ($declaration->skill_id)) { |
|
150 | + $attribute = implode ('.', ['skill_declarations', $key]); |
|
151 | + $skillDeclarationValidator = $skilDeclarationValidatorFactory->validator ($declaration); |
|
152 | + $rules = $this->addNestedValidatorRules ($attribute, $skillDeclarationValidator->getRules (), $rules); |
|
153 | 153 | } |
154 | 154 | } |
155 | 155 | |
156 | - $validator = Validator::make($application->toArray(), $rules); |
|
156 | + $validator = Validator::make ($application->toArray (), $rules); |
|
157 | 157 | return $validator; |
158 | 158 | } |
159 | 159 | |
160 | - public function essentialSkillsValidator(JobApplication $application) { |
|
161 | - return $this->skillsValidator($application, 'essential'); |
|
160 | + public function essentialSkillsValidator(JobApplication $application){ |
|
161 | + return $this->skillsValidator ($application, 'essential'); |
|
162 | 162 | } |
163 | 163 | |
164 | - public function essentialSkillsComplete(JobApplication $application) { |
|
165 | - return $this->essentialSkillsValidator($application)->passes(); |
|
164 | + public function essentialSkillsComplete(JobApplication $application){ |
|
165 | + return $this->essentialSkillsValidator ($application)->passes (); |
|
166 | 166 | } |
167 | 167 | |
168 | - public function assetSkillsValidator(JobApplication $application) { |
|
169 | - return $this->skillsValidator($application, 'asset'); |
|
168 | + public function assetSkillsValidator(JobApplication $application){ |
|
169 | + return $this->skillsValidator ($application, 'asset'); |
|
170 | 170 | } |
171 | 171 | |
172 | - public function assetSkillsComplete(JobApplication $application) { |
|
173 | - return $this->assetSkillsValidator($application)->passes(); |
|
172 | + public function assetSkillsComplete(JobApplication $application){ |
|
173 | + return $this->assetSkillsValidator ($application)->passes (); |
|
174 | 174 | } |
175 | 175 | |
176 | - public function affirmationValidator(JobApplication $application) { |
|
176 | + public function affirmationValidator(JobApplication $application){ |
|
177 | 177 | $rules = [ |
178 | 178 | 'submission_signature' => [ |
179 | 179 | 'required', |
@@ -186,10 +186,10 @@ discard block |
||
186 | 186 | 'max:191', |
187 | 187 | ] |
188 | 188 | ]; |
189 | - return Validator::make($application->toArray(), $rules); |
|
189 | + return Validator::make ($application->toArray (), $rules); |
|
190 | 190 | } |
191 | 191 | |
192 | - public function affirmationComplete(JobApplication $application) { |
|
193 | - return $this->affirmationValidator($application)->passes(); |
|
192 | + public function affirmationComplete(JobApplication $application){ |
|
193 | + return $this->affirmationValidator ($application)->passes (); |
|
194 | 194 | } |
195 | 195 | } |
@@ -7,42 +7,42 @@ |
||
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 | - $this->questionIds = $application->job_poster->job_poster_questions->pluck('id')->toArray(); |
|
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' => [ |
24 | 24 | 'required', |
25 | - Rule::in($this->questionIds), |
|
25 | + Rule::in ($this->questionIds), |
|
26 | 26 | ], |
27 | 27 | 'job_application_id' => [ |
28 | 28 | 'required', |
29 | - Rule::in([$this->application->id]), |
|
29 | + Rule::in ([$this->application->id]), |
|
30 | 30 | ] |
31 | 31 | ]; |
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 | - return Validator::make($answer->toArray(), $this->rules()); |
|
38 | + return Validator::make ($answer->toArray (), $this->rules ()); |
|
39 | 39 | } |
40 | 40 | |
41 | - public function validate(JobApplicationAnswer $answer) { |
|
42 | - return $this->validator($answer)->validate(); |
|
41 | + public function validate(JobApplicationAnswer $answer){ |
|
42 | + return $this->validator ($answer)->validate (); |
|
43 | 43 | } |
44 | 44 | |
45 | - public function isComplete(JobApplicationAnswer $answer) { |
|
46 | - return $this->validator($answer)->passes(); |
|
45 | + public function isComplete(JobApplicationAnswer $answer){ |
|
46 | + return $this->validator ($answer)->passes (); |
|
47 | 47 | } |
48 | 48 | } |
@@ -23,33 +23,33 @@ discard block |
||
23 | 23 | public function __construct(Applicant $applicant) |
24 | 24 | { |
25 | 25 | $this->applicant = $applicant; |
26 | - $this->skill_ids = Skill::all()->pluck('id'); |
|
27 | - $this->skill_status_ids = SkillStatus::all()->pluck('id'); |
|
28 | - $this->skill_level_ids = SkillLevel::all()->pluck('id'); |
|
26 | + $this->skill_ids = Skill::all ()->pluck ('id'); |
|
27 | + $this->skill_status_ids = SkillStatus::all ()->pluck ('id'); |
|
28 | + $this->skill_level_ids = SkillLevel::all ()->pluck ('id'); |
|
29 | 29 | |
30 | 30 | } |
31 | 31 | |
32 | - public function validator(SkillDeclaration $skillDeclaration) { |
|
33 | - $uniqueSkillRule = new UniqueApplicantSkillRule($this->applicant, $skillDeclaration->id); |
|
32 | + public function validator(SkillDeclaration $skillDeclaration){ |
|
33 | + $uniqueSkillRule = new UniqueApplicantSkillRule ($this->applicant, $skillDeclaration->id); |
|
34 | 34 | |
35 | 35 | //Validate basic data is filled in |
36 | - $validator = Validator::make($skillDeclaration->getAttributes(), [ |
|
36 | + $validator = Validator::make ($skillDeclaration->getAttributes (), [ |
|
37 | 37 | 'skill_id' => [ |
38 | 38 | 'required', |
39 | - Rule::in($this->skill_ids->toArray()), |
|
39 | + Rule::in ($this->skill_ids->toArray ()), |
|
40 | 40 | $uniqueSkillRule, |
41 | 41 | ], |
42 | 42 | 'applicant_id' => [ |
43 | 43 | 'required', |
44 | - Rule::in([$this->applicant->id]), |
|
44 | + Rule::in ([$this->applicant->id]), |
|
45 | 45 | ], |
46 | 46 | 'skill_status_id' => [ |
47 | 47 | 'required', |
48 | - Rule::in($this->skill_status_ids->toArray()), |
|
48 | + Rule::in ($this->skill_status_ids->toArray ()), |
|
49 | 49 | ], |
50 | 50 | 'skill_level_id' => [ |
51 | 51 | 'required', |
52 | - Rule::in($this->skill_level_ids->toArray()), |
|
52 | + Rule::in ($this->skill_level_ids->toArray ()), |
|
53 | 53 | ], |
54 | 54 | 'description' => 'required|string', |
55 | 55 | ]); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | public function validate(SkillDeclaration $skillDeclaration) |
60 | 60 | { |
61 | - return $this->validator($skillDeclaration)->validate(); |
|
61 | + return $this->validator ($skillDeclaration)->validate (); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 |
@@ -31,13 +31,13 @@ |
||
31 | 31 | */ |
32 | 32 | public function passes($attribute, $value) |
33 | 33 | { |
34 | - return $value->contains(function ($object) { |
|
35 | - $object->getRelationValue($this->relationName)->is($this->relationValue); |
|
34 | + return $value->contains (function ($object){ |
|
35 | + $object->getRelationValue ($this->relationName)->is ($this->relationValue); |
|
36 | 36 | }); |
37 | 37 | } |
38 | 38 | |
39 | 39 | public function message() |
40 | 40 | { |
41 | - return Lang::get('validation.contains_object_with_relation', ['relation' => $this->relationName]); |
|
41 | + return Lang::get ('validation.contains_object_with_relation', ['relation' => $this->relationName]); |
|
42 | 42 | } |
43 | 43 | } |
@@ -19,13 +19,13 @@ |
||
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 | - return preg_match($passwordPattern, $value); |
|
24 | + return preg_match ($passwordPattern, $value); |
|
25 | 25 | } |
26 | 26 | |
27 | - public function message() { |
|
28 | - return Lang::get('validation.custom.password'); |
|
27 | + public function message(){ |
|
28 | + return Lang::get ('validation.custom.password'); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | protected function array_any(array $array, callable $fn) |
28 | 28 | { |
29 | 29 | foreach ($array as $value) { |
30 | - if ($fn($value)) { |
|
30 | + if ($fn ($value)) { |
|
31 | 31 | return true; |
32 | 32 | } |
33 | 33 | } |
@@ -46,13 +46,13 @@ discard block |
||
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 | } |
53 | 53 | |
54 | 54 | public function message() |
55 | 55 | { |
56 | - return Lang::get('validation.contains_object_with_attribute', ['relation' => $this->attributeName, 'attributeValue' => $this->attributeValue]); |
|
56 | + return Lang::get ('validation.contains_object_with_attribute', ['relation' => $this->attributeName, 'attributeValue' => $this->attributeValue]); |
|
57 | 57 | } |
58 | 58 | } |