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

BatchStoreExperienceSkill   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 13
c 1
b 0
f 0
dl 0
loc 33
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A authorize() 0 3 1
A rules() 0 16 1
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