TestimonialStoreRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 36
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A messages() 0 5 1
A authorize() 0 3 1
A rules() 0 11 1
1
<?php
2
3
namespace App\Http\Requests;
4
5
use Illuminate\Foundation\Http\FormRequest;
6
7
class TestimonialStoreRequest 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
        return true;
17
    }
18
19
    /**
20
     * Get the validation rules that apply to the request.
21
     *
22
     * @return array
23
     */
24
    public function rules()
25
    {
26
        return [
27
            'feedback' => ['required', 'string'],
28
            'name' => ['required', 'string', 'max:255'],
29
            'surname' => ['required', 'string', 'max:255'],
30
            'profession' => ['required', 'string', 'max:255'],
31
            'country_id' => ['required', 'string'],
32
            'photo' => 'mimes:jpg,jpeg,png|max:5120', // 5MB
33
            'personal_data_agreement' => ['required'],
34
            'publish_agreement' => ['required'],
35
        ];
36
    }
37
38
    public function messages()
39
    {
40
        return [
41
            'photo.mimes' => 'Only jpeg, jpg and png images are allowed',
42
            'photos.max' => 'Maximum allowed size for an image is 5MB',
43
        ];
44
    }
45
}
46
47
48
49
50
51
52
53