You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Spatie\MediaLibrary\MediaCollections\FileAdderFactory have method called createFromRequest
So, it only get first file from request with a key because of ->first(). It should have one more function to get all files with a key
For example:
If I have request like that
I can't call $post->addMediaFromRequest('document-file')->toMediaCollection('document-file'); to get all file with document-file key. Also, I can't call $post->addAllMediaFromRequest() because it will get the whole file with both thump & document-file key
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In
Spatie\MediaLibrary\MediaCollections\FileAdderFactory
have method calledcreateFromRequest
So, it only get first file from request with a key because of
->first()
. It should have one more function to get all files with a keyFor example:
If I have request like that
I can't call
$post->addMediaFromRequest('document-file')->toMediaCollection('document-file');
to get all file withdocument-file
key. Also, I can't call$post->addAllMediaFromRequest()
because it will get the whole file with boththump
&document-file
keyBeta Was this translation helpful? Give feedback.
All reactions