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

FaqCategoryRequest::filldata()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
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