Laravel-medialibrary: Spatie\MediaLibrary\Support\UrlGenerator\BaseUrlGenerator::getDiskName() must be of the type string, null returned

Created on 28 Mar 2020  路  4Comments  路  Source: spatie/laravel-medialibrary

SpatieMediaLibrary\Support\UrlGenerator\BaseUrlGenerator::getDiskName() must be of the type string,
null returned

lib/v8.0.6

Most helpful comment

Hi,

Please see https://github.com/spatie/laravel-medialibrary/blob/master/UPGRADING.md , doing the following will solve it.

Add a conversions_disk field to the media table (you'll find the definition in the migrations file of the package) and for each row copy the value of disk to conversions_disk.

I`ve made the same mistake and missed that line too 馃槃

All 4 comments

Hi,

Please see https://github.com/spatie/laravel-medialibrary/blob/master/UPGRADING.md , doing the following will solve it.

Add a conversions_disk field to the media table (you'll find the definition in the migrations file of the package) and for each row copy the value of disk to conversions_disk.

I`ve made the same mistake and missed that line too 馃槃

Thank you

Helped me, too.

Media::cursor()->each(fn (Media $media) => $media->update(['conversions_disk' => $media->disk]));

Was this page helpful?
0 / 5 - 0 ratings