Closed alexandrosraikos closed 3 months ago
I just did a test of this and it seems to be working fine. Can you show me the code which is running into this issue? Here's an example from a file upload form submission which works fine in my tests where a custom name is set:
$file = $request->file('photo');
$pet = new Pet();
$pet->photo = [$file, 'my-photo.jpg'];
$pet->save();
You're right, my bad. The container attribute I was settings also appeared in the fillable
array, so for some reason I couldn't get it in the array format.
Dependencies
Description of the issue:
Uploaded form files (
UploadedFile
instances) don't get saved to containers with the desired filename in the container fields. They are being saved with the temporary PHP blob upload name (phpXXXXX
without extension).Expected Behavior:
The file should be uploaded with the desired filename added in the array.
Steps to reproduce:
[UploadedFile,"filename.ext"]
on the attribute which reflects the container attribute.SomeModel->save()
Additional Information
After a quick debugging session, I noticed that the query internally in
GearboxSolutions\EloquentFileMaker\Services\FileMakerConnection::uploadToContainerField
always retrieves theUploadedFile
object, no matter if I placed it in an array or not.