Responsive images
Opt a bucket into responsive images with ->responsiveWidths(). The package generates one variant per width through the same engine — honouring the sync/queue rules and the variants disk — and never upscales past the original:
$this->addMediaBucket('hero')
->useDisk('public')
->responsiveWidths([480, 960, 1440, 1920]) // omit for the config default ladder
->responsiveFormat('webp'); // optional — defaults to the original's format
$media->srcset();
// "…-480.webp 480w, …-960.webp 960w, …" (ascending, only generated widths)
$media->responsiveImage('', ['alt' => 'Hero', 'sizes' => '100vw', 'class' => 'rounded']);
// full <img> tag with srcset + LQIP blur-up backgroundresponsiveImage() emits a full <img> tag with the smallest generated width as the src fallback, the srcset, optional sizes/alt/class, and the LQIP placeholder as an inline blur-up background. media:regenerate rebuilds widths; media:clean removes orphaned width files.
Show your open-source love
This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.
More ways to support, including cryptoBy donating, you agree to our donation terms.
Want this built into your product?
We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.