SkillScaleRequest::messages()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace App\Http\Requests;
4
5
use Illuminate\Foundation\Http\FormRequest;
6
7
class SkillScaleRequest extends FormRequest
8
{
9
    /**
10
     * Determine if the user is authorized to make this request.
11
     *
12
     * @return bool
13
     */
14
    public function authorize()
15
    {
16
        // only allow updates if the user is logged in
17
        return backpack_auth()->check();
18
    }
19
20
    /**
21
     * Get the validation rules that apply to the request.
22
     *
23
     * @return array
24
     */
25
    public function rules()
26
    {
27
        return [
28
            'name' => 'required|max:255|unique:skill_scales',
29
            'shortname' => 'required|max:8|unique:skill_scales',
30
            'value' => 'required|numeric|between:0,1',
31
        ];
32
    }
33
34
    /**
35
     * Get the validation attributes that apply to the request.
36
     *
37
     * @return array
38
     */
39
    public function attributes()
40
    {
41
        return [
42
            //
43
        ];
44
    }
45
46
    /**
47
     * Get the validation messages that apply to the request.
48
     *
49
     * @return array
50
     */
51
    public function messages()
52
    {
53
        return [
54
            //
55
        ];
56
    }
57
}
58