Closed tylerpixelguild closed 3 years ago
Sorry, I forgot to add my stack trace.
[2020-12-06 21:14:23] local.ERROR: Array to string conversion {"userId":1,"exception":"[object] (ErrorException(code: 0): Array to string conversion at /vendor/laravel/framework/src/Illuminate/Support/Str.php:494) [stacktrace]
"}
Did you set casts in model?
Did you set casts in model?
D'oh!
My bad. Thank you. Great package.
can you tell me how do you solve this problem with casts the model @tylerpixelguild
I've got it working beautifully with a single file upload but when I try to allow multiple files by adding ->array() I get the following error when I try to submit the form for the resource to create.
Array to String conversion - There was a problem submitting the form. ""
It allows me to select multiple images and they display on the page but gives that error on submit.
This is the way I'm using it:
MediaLibrary::make('Image')->array('gallery'),
The column in the database is called "image" and is of the type "text".
If I submit the form without the ->array() option it saves and shows the image properly. I can then add the ->array() option and edit the content and add multiple images without error. It only seems to happen when submitting new content not on editing.