| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function rules() |
||
| 26 | { |
||
| 27 | $rules = [ |
||
| 28 | 'term' => ['required', 'max:255', new LettersAndWhitespaces()], |
||
| 29 | 'definition' => ['required', 'string'], |
||
| 30 | 'body' => ['nullable', 'string'], |
||
| 31 | 'question_type' => ['required', 'string'], |
||
| 32 | ]; |
||
| 33 | |||
| 34 | if (request()->hasFile('introimage')) { |
||
| 35 | $rules['introimage'] = ['nullable', 'image','mimes:jpg,jpeg,png','max:5120']; // 5MB |
||
| 36 | } |
||
| 37 | |||
| 38 | return $rules; |
||
| 39 | } |
||
| 41 |