4 months ago

update form with image

Posted 4 months ago by X-Mac

Good morning, I need update a form with several input + an image field. when I create the record first time I store the image on cloudinary phisically and the path on DB, so when I call the record for modify data and update my input image is empty. Is only set the tag with the cloudinary path. If I change image, the form update works good, but If I update some input and not the image I have the error

Call to a member function realpath() on null

beause my $request->file('cover')->getRealPath() is null.

My idea is check if there is a new image and create 2 different update routine 1 with full fields and 1 without image field update. But I think is a bad idea, some good suggestion?

Please sign in or create an account to participate in this conversation.