We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I set rules to Image field in dependency container it doesnt apply on uploading images. Below is the exact code.
DependencyContainer::make([ Image::make(__('Insurance Image'), 'image') ->rules(['required', 'image','mimes:jpg,jpeg,png', 'max:2000']) ->path('images/loads-insurance'), ])
In this situation every file uploaded and rules ignored.
The text was updated successfully, but these errors were encountered:
hi @ahmadmhm
this code works for me. i will publish y new version in some minutes.
Sorry, something went wrong.
Ok, Thank you
I think this issue is still open right? This is my workarroud:
Create an Hidden dummyfield, which can trigger a custom validation in the Request
DependencyContainer::make([ Image::make(__('Insurance Image'), 'insurance_image'), Hidden::make('insurance_image_validator')->fillUsing(function($request, $model, $attribute, $requestAttribute){ if($request->has('insurance_image')) { $request->validate([ 'insurance_image' => 'required|image|mimes:jpg,jpeg,png|max:2000', ]); } //remove the dummy field from the request $request->request->remove('insurance_image_validator'); }), ]);
No branches or pull requests
When I set rules to Image field in dependency container it doesnt apply on uploading images. Below is the exact code.
In this situation every file uploaded and rules ignored.
The text was updated successfully, but these errors were encountered: