| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php namespace Arcanesoft\Blog\Http\Requests\Admin\Categories; |
||
| 31 | public function rules() |
||
| 32 | { |
||
| 33 | $rules = []; |
||
| 34 | |||
| 35 | // TODO: Adding an 'exists' rule to check if the name exists |
||
| 36 | if ($this->isTranslatable()) |
||
| 37 | $rules['name.*'] = ['required', 'string', 'min:3']; |
||
| 38 | else |
||
| 39 | $rules['name'] = ['required', 'string', 'min:3']; |
||
| 40 | |||
| 41 | return $rules; |
||
| 42 | } |
||
| 43 | } |
||
| 44 |