-
Trying to use Steps To Produce
Code Samplecollect($images)->each(function ($imageUrl) use ($productId) {
$product = Product::find($productId);
$product->addMediaFromUrl($imageUrl)
->toMediaCollection('images', 's3');
}); Did anyone ran into a similar issue, and found a solution around? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Have you added My guess is that the config hasn't been loaded because the service provider isn't loaded, and that means that |
Beta Was this translation helpful? Give feedback.
Have you added
Spatie\MediaLibrary\MediaLibraryServiceProvider::class
to your service providers inconfig/app.php
? 🤔My guess is that the config hasn't been loaded because the service provider isn't loaded, and that means that
media-library.file_namer
isnull
, so this line is probably just resolvingapp()
as the actual application.