Open jahid56 opened 4 years ago
I found that the current issue with this is when you have the field in the database as required (not nullable). I guess that happens because they first need to save the record to be able to attach the uploaded image/file to that record. You can prevent the form from submitting without an image with the rules() method.
That will solve your current issue.
When I user
Files
it returns error for mimes validation. It Throws error for pdf file and when I remove mimes validation it shows errorSQLSTATE[HY000]: General error: 1364 Field 'model_type' doesn't have a default value
. Here is my code ``
And My Model Code Are
public function registerMediaCollections() { $this->addMediaCollection('vendor_kit')->singleFile(); $this->addMediaCollection('banner'); }