I have a model with three media libraries defined
public function registerMediaCollections(): void {
$this->addMediaCollection( 'icon' )
->singleFile()
->withResponsiveImages()
->useFallbackUrl( asset( 'solar-energy.png' ) )
->registerMediaConversions( function ( Media $media ) {
$this
->addMediaConversion( 'preview' )
->width( 300 )
->height( 300 );
} );
$this->addMediaCollection( 'documents' )
->withResponsiveImages()
->registerMediaConversions( function ( Media $media ) {
$this
->addMediaConversion( 'preview' )
->width( 300 )
->height( 300 );
} );
$this->addMediaCollection( 'confidential_documents' )
->withResponsiveImages()
->registerMediaConversions( function ( Media $media ) {
$this
->addMediaConversion( 'preview' )
->width( 300 )
->height( 300 );
} );
}
If I upload an image to any of the media libraries the preview is generated, the icon library seems to work fine - on page reload the preview image is there and confirmed it exists on the filesystem in the conversions sub-directory.
If I upload to the documents media library, the preview is generated again, however on a page reload the image isn't shown and we get a placeholder image. There is no conversions sub directory.
It seems conversions is working for one library but not the others.
All the libraries share the same config
FILESYSTEM_DISK=digitalocean
MEDIA_DISK=digitalocean
QUEUE_CONVERSIONS_BY_DEFAULT=false
All three are saved like this and they are saved, just the conversions aren't triggering for two of the libraries.
$this->job
->syncFromMediaLibraryRequest( $this->files )
->toMediaCollection( 'files' );
Running artisan media-library:regenerate doesn't seem to resolve the issue either
Am I missing something?