Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Image Variants

Laravel Image Variants Laravel Package

fruitcake/laravel-image-variants

A Laravel package for defining and generating image variants, such as thumbnails and responsive sizes, and exposing them through simple URLs or srcsets. Streamlines image processing and delivery in Laravel applications.

View on GitHub
Deep Wiki
Context7

Laravel Image Variants

Frequently asked questions about Laravel Image Variants
How do I install fruitcake/laravel-image-variants in a Laravel app?
Install it with composer require fruitcake/laravel-image-variants, then publish the package config and wire up a writable filesystem disk. You also need a working image driver, either GD or Imagick, available in your PHP environment. The integration is conventional Laravel package setup and should take roughly a day for a first working slice.
Which Laravel versions does fruitcake/laravel-image-variants support?
Version 0.2.2 raises the framework floor to Laravel 13.25.0 specifically so it can use toFormat() directly. That is a hard coupling to a specific Laravel minor rather than a soft recommendation. Check whether the Composer constraint is ^13.25 or a stricter minimum before assuming flexibility, and do not expect it to resolve on Laravel 12 or 13.24.
Does Laravel Image Variants require GD or Imagick?
Yes. The package integrates with Intervention Image, so you need a functioning image driver such as GD or Imagick in your PHP runtime. Both are common prerequisites in Laravel deployments, but confirm the driver is enabled and has enough memory for the largest source images you plan to process.
How does URL-driven image resizing and cropping work?
You expose variant URLs containing parameters for resizing, cropping, and format conversion, and the package generates the variant on demand the first time it is requested. The generated file is then cached so repeat requests are served quickly without reprocessing. This lets you create responsive thumbnails without pre-generating every possible size.
Can I define reusable image presets and default parameters?
Yes. The package supports configurable presets and default parameters, and variant definitions are chainable. Presets are useful for keeping URL parameters consistent across templates and for treating your variant URL shape as a stable public contract. Because the package is pre-1.0, review config keys after each minor upgrade.
Where are generated image variants cached, and can I use S3?
Variants are cached through Laravel filesystem disks, so you can use a local disk or an S3-compatible object store. This fits naturally with CDN-fronted applications where cached variants are served from object storage. Make sure the configured disk is writable and that cache and CDN rules account for the variant URL patterns you expose.
Is fruitcake/laravel-image-variants stable enough for production?
At v0.2.x there is no semver guarantee on config keys, route patterns, or public methods, so any minor bump can break consumers. Pin the package constraint explicitly rather than floating on ^0.2. Treat upgrades as coordinated changes, especially when a release also raises the Laravel minimum version.
Does it support WebP or other image format conversion?
Yes, URL-driven format conversion is a core feature alongside resizing and cropping. Version 0.2.2 uses Laravel's toFormat() directly, which couples variant encoding behavior to Laravel's implementation. Before upgrading, confirm whether output format, quality defaults, EXIF handling, or color profiles change compared with v0.2.1.
Can image variant generation be queued instead of done during the request?
The documented overview describes on-demand generation on the request path with caching for repeat delivery, and does not state queued generation support. If request latency matters for large source images, verify whether queued generation is supported or whether you need to warm the cache separately. The package fits alongside existing queue workers if you dispatch generation yourself, but confirm before designing around it.
What are alternatives to fruitcake/laravel-image-variants?
Common alternatives include using Intervention Image directly, a Glide-based image manipulation server, or a media library package such as spatie/laravel-medialibrary that manages conversions alongside models. This package is a good fit when you specifically want URL-driven, cached variants with minimal ceremony in Laravel. Evaluate against a Laravel 13.25 baseline so you are not adopting a version you cannot run.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource