<?php
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
class YourModel implements HasMedia
{
use InteractsWithMedia;
public function registerMediaConversions(Media $media = null): void
{
$this->addMediaConversion('thumb')
->width(70)
->height(70);
$this->addMediaConversion('block')
->width(100)
->height(100);
$this->addMediaConversion('new_conversion')
->width(152)
->height(152);
}
}
?>
1条答案
按热度按时间31moq8wy1#
我知道,这是可能的添加一个新的转换到现有的媒体收藏在Laravel通过使用spalie MediaLibrary.
字符串