> */ public function rules(): array { return [ // `image` alone accepts SVG and any other raster format the server // can decode, including formats browsers cannot display safely. // Pinning the list keeps the upload surface small and predictable: // no SVG means no stored script, and no BMP/TIFF means nothing that // would need converting before a browser can show it. 'file' => [ 'required', 'file', 'image', 'mimes:jpg,jpeg,png,webp,gif', 'max:4096', 'dimensions:min_width=1,min_height=1,max_width=6000,max_height=6000', ], ]; } public function messages(): array { return [ 'file.required' => 'فایلی انتخاب نشده است.', 'file.image' => 'فایل انتخاب‌شده یک تصویر معتبر نیست.', 'file.mimes' => 'فقط فرمت‌های jpg، png، webp و gif پذیرفته می‌شود.', 'file.max' => 'حجم تصویر نباید بیشتر از ۴ مگابایت باشد.', 'file.dimensions' => 'ابعاد تصویر مجاز نیست.', ]; } public function attributes(): array { return ['file' => 'تصویر']; } }