Passed
Push — master ( 0378d7...bd60cc )
by
04:19
created

FaqCategoryRequest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 42
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A filldata() 0 5 1
A authorize() 0 3 1
A messages() 0 4 1
A rules() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Qsnh/meedu.
5
 *
6
 * (c) XiaoTeng <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace App\Http\Requests\Backend;
13
14
use Illuminate\Foundation\Http\FormRequest;
15
16
class FaqCategoryRequest extends FormRequest
17
{
18
    /**
19
     * Determine if the user is authorized to make this request.
20
     *
21
     * @return bool
22
     */
23
    public function authorize()
24
    {
25
        return true;
26
    }
27
28
    /**
29
     * Get the validation rules that apply to the request.
30
     *
31
     * @return array
32
     */
33
    public function rules()
34
    {
35
        return [
36
            'name' => 'required',
37
        ];
38
    }
39
40
    /**
41
     * @return array
42
     */
43
    public function messages(): array
44
    {
45
        return [
46
            'name.required' => '请输入分类名',
47
        ];
48
    }
49
50
    /**
51
     * @return array
52
     */
53
    public function filldata(): array
54
    {
55
        return [
56
            'sort' => $this->input('sort', 0),
57
            'name' => $this->input('name'),
58
        ];
59
    }
60
}
61