1 | <?php namespace Arcanesoft\Blog\Http\Requests\Admin\Posts; |
||
14 | class UpdatePostRequest extends FormRequest |
||
15 | { |
||
16 | /* ------------------------------------------------------------------------------------------------ |
||
17 | | Properties |
||
18 | | ------------------------------------------------------------------------------------------------ |
||
19 | */ |
||
20 | /** |
||
21 | * Category validation rules. |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $rules = [ |
||
26 | 'title' => 'required|max:255', |
||
27 | 'excerpt' => 'required|max:200', |
||
28 | 'content' => 'required', |
||
29 | 'category' => 'required|min:1', |
||
30 | 'tags' => 'required|array|min:1', |
||
31 | 'publish_date' => 'required|date|date_format:Y-m-d', |
||
32 | 'status' => 'required', |
||
33 | ]; |
||
34 | |||
35 | /* ------------------------------------------------------------------------------------------------ |
||
36 | | Main Functions |
||
37 | | ------------------------------------------------------------------------------------------------ |
||
38 | */ |
||
39 | /** |
||
40 | * Determine if the user is authorized to make this request. |
||
41 | * |
||
42 | * @return bool |
||
43 | */ |
||
44 | public function authorize() |
||
48 | |||
49 | /** |
||
50 | * Get the validation rules that apply to the request. |
||
51 | * |
||
52 | * @return array |
||
53 | */ |
||
54 | public function rules() |
||
58 | |||
59 | /* ------------------------------------------------------------------------------------------------ |
||
60 | | Other Functions |
||
61 | | ------------------------------------------------------------------------------------------------ |
||
62 | */ |
||
63 | /** |
||
64 | * Update request rules. |
||
65 | * |
||
66 | * @param array $rules |
||
67 | * |
||
68 | * @return array |
||
69 | */ |
||
70 | private function updateRules(array $rules) |
||
78 | } |
||
79 |