mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 00:21:08 +03:30
testing
This commit is contained in:
+8
-14
@@ -40,30 +40,24 @@ class Item extends Model implements HasMedia
|
||||
|
||||
public function registerMediaCollections(): void
|
||||
{
|
||||
$this->addMediaCollection( 'main_image' )
|
||||
->useFallbackUrl( config( 'media-library.wm-cdn' ) . '/images/placeholder/blog-placeholder.jpg' )
|
||||
->useFallbackPath( public_path( '/images/placeholder/blog-placeholder.jpg' ) )
|
||||
->singleFile();
|
||||
$this->addMediaCollection('files')
|
||||
->useFallbackUrl('/files/default_pastry.jpg')
|
||||
->useFallbackPath(public_path('/files/default_pastry.jpg'));
|
||||
}
|
||||
|
||||
public function registerMediaConversions( Media $media = null )
|
||||
{
|
||||
$crop = $media->getCustomProperty( 'crop' );
|
||||
$conversion = $this->addMediaConversion( 'thumbnail' );
|
||||
$conversion = ! $crop ? $conversion : $conversion->manualCrop( $crop[ 'width' ] , $crop[ 'height' ] , $crop[ 'left' ] , $crop[ 'top' ] );
|
||||
$conversion->nonQueued()
|
||||
->performOnCollections( 'main_image' );
|
||||
|
||||
$this->addMediaConversion( 'thumbnail' )
|
||||
->width( 400 )
|
||||
$this->addMediaConversion('thumbnail')
|
||||
->width(480)
|
||||
->height(640)
|
||||
->nonQueued()
|
||||
->performOnCollections( 'images' );
|
||||
->performOnCollections('files');
|
||||
}
|
||||
|
||||
protected static function getValidCollections(): array
|
||||
{
|
||||
return [
|
||||
'images' ,
|
||||
'files'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user