Completed
Push — master ( 392bd3...60208d )
by ARCANEDEV
04:52
created

UpdatePostRequest::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php namespace Arcanesoft\Blog\Http\Requests\Backend\Posts;
2
3
use Arcanesoft\Blog\Bases\FormRequest;
4
5
/**
6
 * Class     UpdatePostRequest
7
 *
8
 * @package  Arcanesoft\Blog\Http\Requests\Backend\Posts
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class UpdatePostRequest extends FormRequest
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Properties
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    /**
18
     * Category validation rules.
19
     *
20
     * @var array
21
     */
22
    protected $rules = [
23
        'title'        => 'required|max:255',
24
        'excerpt'      => 'required|max:200',
25
        'content'      => 'required',
26
        'category'     => 'required|min:1',
27
        'tags'         => 'required|array|min:1',
28
        'publish_date' => 'required',
29
        'status'       => 'required',
30
    ];
31
32
    /* ------------------------------------------------------------------------------------------------
33
     |  Main Functions
34
     | ------------------------------------------------------------------------------------------------
35
     */
36
    /**
37
     * Determine if the user is authorized to make this request.
38
     *
39
     * @return bool
40
     */
41
    public function authorize()
42
    {
43
        return true;
44
    }
45
46
    /**
47
     * Get the validation rules that apply to the request.
48
     *
49
     * @return array
50
     */
51
    public function rules()
52
    {
53
        return $this->rules;
54
    }
55
}
56