spatie/laravel-medialibrary-pro-app

No thumbnail showing after save

Closed this issue · 1 comments

Hi there,

I have a weird issue where after save/store the thumbnail is not showing on MediaLibraryCollection vue component. Any idea what i'm doing wrong here?

CleanShot.2022-01-15.at.01.50.25.mp4

Never mind, after adding the following to my model it's now working;

use Spatie\Image\Manipulations;
use Spatie\MediaLibrary\MediaCollections\Models\Media;

.....

public function registerMediaConversions(Media $media = null): void
{
   $this
       ->addMediaConversion('preview')
       ->fit(Manipulations::FIT_CROP, 300, 300)
       ->nonQueued();
}