Laravel 9: Dropzone showing [object object] and returns error (field is required)? #2181
Unanswered
DevMushref
asked this question in
Q&A
Replies: 1 comment
-
In your validation request the field name is Change your Dropzone config:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Starting off by saying I followed the documentation of Dropzone: Combining data with files
I created a custom button to process queued files instead of the default submit button of the form
This my Dropzone JS code block:
and this is the HTML:
Side note: I am using Form Validator with the form
Now let's get to the problem.
Every time I try to process queued files I get this error in laravel debugbar:
ir number
is actually a field in the form and is filled! Actually all the required fields of the form are filled. Of course since it's laravel, I have a Request file which tells which field is required and what type of field is it:I also have a dynamic action class which is responsible for file uploads across the entire application:
I
resolve()
that action in the Service class like so:then use
handleAttachments()
method in thestoreReport()
:So basically I am combining the files and data to be uploaded within a single
validated()
request. This practice is working perfectly across all other pages, but since I added Dropzone, I got the error you see above in the debugbar.What happens when you submit the form?
I tried making the submit button process the queues and submit the form, but then I get validation error saying
attachment field is required
.What's going on here exatly?
Your support is highly appreciated
Beta Was this translation helpful? Give feedback.
All reactions