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 was wondering if there is possibility add conversions on the fly, before adding media to model.
I tried something like this, but it seems like conversions are being ignored if they are added this way.
// $this being the model with HasMedia interface and InteractsWithMedia traituseSpatie\MediaLibrary\Conversions\Conversion;
$this->mediaConversions = [
Conversion::create('name')
->withResponsiveImages()
->performOnCollections('default')
->format('webp'),
Conversion::create('another-one')
->withResponsiveImages()
->performOnCollections('default')
->format('webp'),
];
$this->addMedia($filePath)->toMediaCollection();
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.
-
Hi there,
I was wondering if there is possibility add conversions on the fly, before adding media to model.
I tried something like this, but it seems like conversions are being ignored if they are added this way.
Is this somehow possible to do ?
Something like this would be nice:
But
withConversions
doesn't exist in v10Thank you for answering.
Beta Was this translation helpful? Give feedback.
All reactions