| Total Complexity | 4 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class FaqArticleRequest 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 | 'category_id' => 'required', |
||
| 37 | 'title' => 'required|max:255', |
||
| 38 | 'content' => 'required', |
||
| 39 | ]; |
||
| 40 | } |
||
| 41 | |||
| 42 | public function messages() |
||
| 43 | { |
||
| 44 | return [ |
||
| 45 | 'category_id.required' => '请选择分类', |
||
| 46 | 'title.required' => '请输入标题', |
||
| 47 | 'title.max' => '标题不能超过255个字', |
||
| 48 | 'content.required' => '请输入内容', |
||
| 49 | ]; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return array |
||
| 54 | */ |
||
| 55 | public function filldata(): array |
||
| 62 | ]; |
||
| 63 | } |
||
| 64 | } |
||
| 65 |