folklore / laravel-image
On-the-fly image renditions for Laravel: presets, signed URLs and responsive variants, behind a CDN
Requires
- php: ^8.3
- illuminate/config: ^12.0|^13.0
- illuminate/console: ^12.0|^13.0
- illuminate/contracts: ^12.0|^13.0
- illuminate/filesystem: ^12.0|^13.0
- illuminate/http: ^12.0|^13.0
- illuminate/routing: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
- intervention/image: ^4.3.4
- league/flysystem: ^3.25.1
Requires (Dev)
- intervention/image-driver-vips: ^4.1
- larastan/larastan: ^3.0
- laravel/pint: ^1.24
- league/flysystem-aws-s3-v3: ^3.25.1
- mockery/mockery: ^1.6
- orchestra/testbench: ^10.0|^11.0
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpunit: ^11.5|^12.0
Suggests
- ext-exif: Turns photos upright from their EXIF orientation
- ext-imagick: Required by the imagick driver
- folklore/laravel-mediatheque: The media resolver (2.x), for the images and video posters of a media library
- intervention/image-driver-vips: The libvips driver, the fastest and the lightest on memory (needs libvips and ext-ffi with ffi.enable=true)
- league/flysystem-aws-s3-v3: Originals and derivatives on S3-compatible disks
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-29 18:55:56 UTC
README
On-the-fly image renditions for Laravel: presets, crops, formats and responsive variants, rendered once and served behind a CDN.
This is the
v2.xbranch, where 2.0 is developed, and the default branch. 2.0 is released as alphas (composer require folklore/laravel-image:^2.0@alpha, PHP 8.3+ and Laravel 12+); an alpha can break the previous one, so read the CHANGELOG before you update. 1.x is maintained onv1.x:composer require folklore/laravel-image:^1.1.
2.0
2.0 is built on Intervention Image 4, with libvips when available:
Image::for($media)->preset('card')->url(); Image::for('uploads/photo.jpg')->width(800)->ratio('16:9')->avif()->url(); Image::for($media)->variants('card'); // width, height and URL of each variant, for APIs
In the alphas today:
- Presets and canonical specs, in versioned URLs that change when a preset or an original changes.
- Secure by default: opt-in routes (
Route::image()), presets or signed URLs only, enforced limits, private images through expiring URLs. - Derivatives rendered once with libvips, Imagick or GD, stored on any Laravel disk with a lock per variant, served with long-lived caching headers behind a CDN.
- Sources resolved from disks, and from media ids with
laravel-mediatheque2'smediaresolver. ImageVariantResource,Image::fake()andimage:doctor.
Upgrading from 1.x: 1.x URLs keep working through Route::imageLegacy(), and a compatibility layer keeps the 1.x API working, deprecated, until 3.0. php artisan image:upgrade --check lists what a project uses; docs/upgrade.md has the steps.
Planned (roadmap): focal point and non-destructive edits (transform), channel presets, responsive images with srcset() and <x-image>, more operations, and the Rector rules of the upgrade.
The guides of the alpha are in docs/guides/: getting started, presets, URLs and signatures and delivery behind a CDN.
The plan is in docs/: the architecture, the decisions, the roadmap and the upgrade guide. #3 is the index of the plan and tracks 1.x.
Contributing
See CONTRIBUTING.md for the workflow, and SECURITY.md to report a vulnerability privately.
License
MIT. See LICENSE.md.