Can't use FileUpload with multiple
I have a resource form with FileUpload. FileUpload works fine
with out using the "multiple". But when using multiple
I get this error:
Illuminate\Database\Grammar::parameterize(): Argument #1 ($values) must be of type array, int given,
EMPLOYEE Model
Employee Resource
2 Replies
Hi,
You have multiple attachments but your model only hasOne
Don't think below will solve the problem, but it is the first step
if I use hasMany in the model I get this error.
ERROR:
If I understand it correctly from this
https://filamentphp.com/docs/3.x/forms/advanced#saving-data-to-relationships
thats how I use the FileUpload inside the component Section with relationship.
I thought hasOne will work, since multiple in FileUpload will
store an array of multiple filename( in my case: attachment_path) in a column.
I was expecting my database would store the record like this if I use
->multiple()
if I use hasMany in the model I get this error.
ERROR:
If I understand it correctly from this
https://filamentphp.com/docs/3.x/forms/advanced#saving-data-to-relationships
thats how I use the FileUpload inside the component Section with relationship.
I thought hasOne will work, since multiple in FileUpload will
store an array of multiple filename( in my case: attachment_path) in a column.
I was expecting my database would store the record like this if I use
->multiple()