UpdateAlbum   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 5 1
A attributes() 0 5 1
A messages() 0 7 1
A authorize() 0 3 1
1
<?php
2
3
namespace Itstructure\MFU\Http\Requests;
4
5
use Illuminate\Foundation\Http\FormRequest;
6
7
/**
8
 * Class UpdateAlbum
9
 * @package Itstructure\MFU\Http\Requests
10
 */
11
class UpdateAlbum extends FormRequest
12
{
13
    /**
14
     * Determine if the user is authorized to make this request.
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
            'title' => 'required|string|min:3|max:64',
32
            'description' => 'required|string|min:3|max:2048'
33
        ];
34
    }
35
36
    /**
37
     * Get the error messages for the defined validation rules.
38
     *
39
     * @return array
40
     */
41
    public function messages()
42
    {
43
        return [
44
            'required' => __('uploader::validation.required'),
45
            'string' => __('uploader::validation.string'),
46
            'min' => __('uploader::validation.min'),
47
            'max' => __('uploader::validation.max'),
48
        ];
49
    }
50
51
    /**
52
     * Get custom attributes for validator errors.
53
     *
54
     * @return array
55
     */
56
    public function attributes()
57
    {
58
        return [
59
            'title' => __('uploader::main.title'),
60
            'description' => __('uploader::main.description'),
61
        ];
62
    }
63
}
64