-
Notifications
You must be signed in to change notification settings - Fork 901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] image [pro] field validation #5702
Comments
may cause #5409 |
Hey @manfield Yes, your right.. sorry for the inconvinience. Thanks for reporting the bug. |
Hey @pxpm Add following to 'main_image' => ValidUpload::field('required')->file('file|mimes:jpeg,jpg,png,jpg,gif,svg|max:2048'), |
Hey @karandatwani92 I think we have already talked about this before.
The image fields sends a base64 encoded string. For that you require something that can validate base64. Here is my answer on a previous question regarding the same subject: Laravel-Backpack/community-forum#722 (comment) We don't want to introduce a dependency just for validating one field type, so we are considering creating a separate package Cheers |
Bug report
What I did
According to documentation:
[Step 7.](https://backpackforlaravel.com/docs/6.x/upgrade-guide#step-7) (OPTIONAL) If you were manually validating the upload, upload_multiple or image field to do complex stuff, v6 provides an easier way to do it; check [the upload field docs](https://backpackforlaravel.com/docs/6.x/crud-fields#upload), [upload_multiple field docs](https://backpackforlaravel.com/docs/6.x/crud-fields#upload_ultiple_) for the new validation classes we've introduced - ValidUpload and ValidUploadMultiple;
image validation should be possible as it is for the upload field.
I created a CrudController containing this field:
same exact behaviour if I move validation to the ModelCrudRequest file like this:
What I expected to happen
I expect image is processed as any other upload.
Instead validation always fails, even if the constraints are satisfied.
Is it a bug in the latest version of Backpack?
yes
Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:The text was updated successfully, but these errors were encountered: