0

I'm saving an Image when creating a post in my controller using the code below:

$post->addMedia($file)->withResponsiveImages()->toMediaCollection();

And displaying the responsive images in my blade file with:
{{ $post->getFirstMedia() }}

This works and I get the responsive images in a srcset attribute.

Is it possible to display responsive backround images using the libray?

Alphy Gacheru
  • 489
  • 1
  • 9
  • 28

0 Answers0