Is there a way to reuse image from request? #3218
Unanswered
secretwebmaster
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For example, when doing a bulk update of models, we can create a simple form in blade and send the data to controller.
For simple text field, we can use:
But for image field, if we do it in similar way, only first model will be updated because the request->image field will be deleted after the first addMediaFromRequest.
Here is my current workarround. Add the media to first model and use preservingOriginal() to add to the rest. Is there any way like preservingRequest()? Then I could simply foreach all models and addMediaFromRequest(). Thank you.
Beta Was this translation helpful? Give feedback.
All reactions