| Total Complexity | 3 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class ImageUploadRequest extends FormRequest |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Determine if the user is authorized to make this request. |
||
| 13 | * |
||
| 14 | * @return bool |
||
| 15 | */ |
||
| 16 | public function authorize() |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Get the validation rules that apply to the request. |
||
| 23 | * |
||
| 24 | * @return array |
||
| 25 | */ |
||
| 26 | public function rules() |
||
| 27 | { |
||
| 28 | $size = config('media-library.max_file_size'); |
||
| 29 | |||
| 30 | return [ |
||
| 31 | 'image' => [ |
||
| 32 | 'required', |
||
| 33 | 'mimes:jpeg,png', |
||
| 34 | 'image', |
||
| 35 | 'max:'.$size, |
||
| 36 | ], |
||
| 37 | ]; |
||
| 38 | } |
||
| 39 | |||
| 40 | protected function failedValidation(Validator $validator) |
||
| 46 | ); |
||
| 47 | } |
||
| 49 |