diff --git a/innopacks/front/src/Requests/UploadImageRequest.php b/innopacks/front/src/Requests/UploadImageRequest.php index f00c7edc..2b01235a 100755 --- a/innopacks/front/src/Requests/UploadImageRequest.php +++ b/innopacks/front/src/Requests/UploadImageRequest.php @@ -30,8 +30,14 @@ public function authorize(): bool */ public function rules(): array { + if (is_admin()) { + $rule = 'required|image|mimes:jpg,png,jpeg,gif,svg,webp|max:4096'; + } else { + $rule = 'required|image|mimes:jpg,png,jpeg,gif,webp|max:2048'; + } + return [ - 'image' => 'required|image|mimes:jpg,png,jpeg,gif,svg,webp|max:4096', + 'image' => $rule, 'type' => 'required|alpha_dash', ]; }