Passed
Push — feature/basic-application-endp... ( 39b0fe )
by Chris
06:14
created

UpdateJobApplicationBasic::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 19
c 1
b 0
f 0
dl 0
loc 24
rs 9.6333
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Http\Requests;
4
5
use App\Models\Lookup\CitizenshipDeclaration;
6
use App\Models\Lookup\PreferredLanguage;
7
use App\Models\Lookup\VeteranStatus;
8
use App\Services\Validation\Rules\ValidIdRule;
9
use Illuminate\Foundation\Http\FormRequest;
10
11
class UpdateJobApplicationBasic extends FormRequest
12
{
13
    /**
14
     * User authorization handled in routes/web.php.
15
     *
16
     * @return bool
17
     */
18
    public function authorize()
19
    {
20
        return true;
21
    }
22
23
    /**
24
     * Get the validation rules that apply to the request.
25
     *
26
     * @return array
27
     */
28
    public function rules()
29
    {
30
        return [
31
            'citizenship_declaration_id' => [
32
                'bail',
33
                'required',
34
                'numeric',
35
                new ValidIdRule(CitizenshipDeclaration::class)
36
            ],
37
            'veteran_status_id' => [
38
                'bail',
39
                'required',
40
                'numeric',
41
                new ValidIdRule(VeteranStatus::class)
42
            ],
43
            'preferred_language_id' => [
44
                'bail',
45
                'required',
46
                'numeric',
47
                new ValidIdRule(PreferredLanguage::class)
48
            ],
49
            'language_requirement_confirmed' => 'required|boolean',
50
            'language_test_confirmed' => 'required|boolean',
51
            'education_requirement_confirmed' => 'required|boolean',
52
        ];
53
    }
54
}
55