| Total Complexity | 4 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class SkillCrudRequest extends FormRequest |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Determine if the user is authorized to make this request. |
||
| 13 | * |
||
| 14 | * @return boolean |
||
| 15 | */ |
||
| 16 | public function authorize() : bool |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Get the validation rules that apply to the request. |
||
| 24 | * |
||
| 25 | * @return string[] |
||
| 26 | */ |
||
| 27 | public function rules() : array |
||
| 28 | { |
||
| 29 | return [ |
||
| 30 | 'name' => 'required|unique_translation:skills,name' . (isset($this->id) ? ",{$this->id}" : ''), |
||
| 31 | 'description' => 'required', |
||
| 32 | 'skill_type_id' => 'exists:skill_types,id' |
||
| 33 | ]; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Get the validation messages that apply to the request. |
||
| 38 | * |
||
| 39 | * @return string[] |
||
| 40 | */ |
||
| 41 | public function messages() : array |
||
| 47 | ]; |
||
| 48 | } |
||
| 50 |