| Total Complexity | 4 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class StoreAlbum extends FormRequest |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Determine if the user is authorized to make this request. |
||
| 15 | * |
||
| 16 | * @return bool |
||
| 17 | */ |
||
| 18 | public function authorize() |
||
| 19 | { |
||
| 20 | return true; |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Get the validation rules that apply to the request. |
||
| 25 | * |
||
| 26 | * @return array |
||
| 27 | */ |
||
| 28 | public function rules() |
||
| 29 | { |
||
| 30 | return [ |
||
| 31 | 'title' => 'required|string|min:3|max:64', |
||
| 32 | 'description' => 'required|string|min:3|max:2048' |
||
| 33 | ]; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Get the error messages for the defined validation rules. |
||
| 38 | * |
||
| 39 | * @return array |
||
| 40 | */ |
||
| 41 | public function messages() |
||
| 42 | { |
||
| 43 | return [ |
||
| 44 | 'required' => __('uploader::validation.required'), |
||
| 45 | 'string' => __('uploader::validation.string'), |
||
| 46 | 'min' => __('uploader::validation.min'), |
||
| 47 | 'max' => __('uploader::validation.max'), |
||
| 48 | ]; |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Get custom attributes for validator errors. |
||
| 53 | * |
||
| 54 | * @return array |
||
| 55 | */ |
||
| 56 | public function attributes() |
||
| 61 | ]; |
||
| 62 | } |
||
| 63 | } |
||
| 64 |