Laravel-medialibrary: registerMediaConversions() function is not working

Created on 3 Sep 2018  路  3Comments  路  Source: spatie/laravel-medialibrary

public function registerMediaConversions(Media $media = null)
    {
        try {
            $this->addMediaConversion('mini')
                ->width(500)
                ->height(500)
                ->performOnCollections('avatar');
        } catch (InvalidManipulation $e) {
        }
    }
public function registerMediaCollections()
    {
        $this
            ->addMediaCollection('avatar')
            ->singleFile();
    }

When I attach the image to the model no error is showing up, even when I try to retrieve the path to mini I got this:

$personal->getFirstMedia('avatar')->getUrl('mini');
=> "/storage/2/conversions/1-mini.jpg"

errar

But as you can see no conversion is stored, only the main collection image.

I am using v7 of the library.

Most helpful comment

Had the same problem because I haven't setup a queue at this points. You need to do that and you will get the converted images.

All 3 comments

The tests around this prove that the functionality is working as intended. Could you PR a failing test?

Had the same problem because I haven't setup a queue at this points. You need to do that and you will get the converted images.

Was this page helpful?
0 / 5 - 0 ratings