Passed
Push — task/batch-request-skills-step ( 9a97f0 )
by Yonathan
07:29
created

BatchStoreExperienceSkill::authorize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Http\Requests;
4
5
use App\Models\ExperienceAward;
6
use App\Models\ExperienceCommunity;
7
use App\Models\ExperienceEducation;
8
use App\Models\ExperiencePersonal;
9
use App\Models\ExperienceSkill;
10
use App\Models\ExperienceWork;
11
use Illuminate\Foundation\Http\FormRequest;
12
use Illuminate\Validation\Rule;
13
14
class BatchStoreExperienceSkill extends FormRequest
15
{
16
    /**
17
     * Determine if the user is authorized to make this request.
18
     *
19
     * @return bool
20
     */
21
    public function authorize()
22
    {
23
        return true;
24
    }
25
26
    /**
27
     * Get the validation rules that apply to the request.
28
     *
29
     * @return array
30
     */
31
    public function rules()
32
    {
33
        return [
34
            '*.skill_id' => 'required|exists:skills,id',
35
            '*.justification' => 'nullable|string',
36
            '*.experience_type' => ['
37
                required',
38
                Rule::in([
39
                    'experience_work',
40
                    'experience_award',
41
                    'experience_community',
42
                    'experience_personal',
43
                    'experience_education'
44
                ])
45
            ],
46
            '*.experience_id' => 'required|integer'
47
        ];
48
    }
49
}
50