Replies: 2 comments
-
Or i have to make crutch, something like this? public function registerMediaCollections(): void
{
foreach (MediaCollectionEnum::cases() as $collection) {
$this->addMediaCollection($collection->name)
->registerMediaConversions(function (Media $media) {
$conversion = $this->addMediaConversion('default');
if ($media->type === 'image') {
$conversion->width(1920)
->format('webp')
->fit(Fit::Contain);
}
});
}
} But then I get |
Beta Was this translation helpful? Give feedback.
0 replies
-
Or i should use this? $media->getUrl(
$media->hasGeneratedConversion('default') ? 'default' : ''
); Or this? $media->getAvailableUrl(['default']) |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Here is my model:
Here is adding media (i am using Nuxt File Storage):
But after uploading
Dinner.pdf
, i am getting this url:Why

webp
?Everything in the database indicates that this is a
pdf
:My food menu files can be either images or pdf files.
Tell me, is this a bug or a feature? What can I do in my situation?
Beta Was this translation helpful? Give feedback.
All reactions