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
I'd like to create a few categories/arrays of asset types based on mime type. Say, 'Images' contains PNG,JPEG,TIF and 'Documents' contains PDF, DOC and so on.
Assuming I have those two set as arrays or something, I'm unsure as to how I can get that detail and push it into the custom properties on upload.
I see there's a callback in usingName that allows one to to this: ->usingName(fn(MediaLibraryRequestItem $item) => strtolower($item->name))
is the same capability exposed for withCustomProperties?
The reason I'm doing this is so I can filter media by these categories. So when uploading, in pseudo, I'd say
if(mime-type IN imagesArray) {
$customerProperty = 'Image'
}
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.
-
I'd like to create a few categories/arrays of asset types based on mime type. Say, 'Images' contains PNG,JPEG,TIF and 'Documents' contains PDF, DOC and so on.
Assuming I have those two set as arrays or something, I'm unsure as to how I can get that detail and push it into the custom properties on upload.
I see there's a callback in
usingName
that allows one to to this:->usingName(fn(MediaLibraryRequestItem $item) => strtolower($item->name))
is the same capability exposed for
withCustomProperties
?The reason I'm doing this is so I can filter media by these categories. So when uploading, in pseudo, I'd say
Beta Was this translation helpful? Give feedback.
All reactions