folklore/laravel-image
Laravel Image
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.
Planned (roadmap): focal point and non-destructive edits (transform), channel presets, responsive images with srcset() and <x-image>, more operations, and for the beta, a compatibility layer that keeps 1.x URLs and the 1.x API working until 3.0.
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.
Related Packages
Dynamically resize an image and returns the URL using Intervention and Storage
Simplified and ready image manipulation for Laravel via intervention image.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.1.1 | ^8.2 | ^9.0| | MIT | |
| v1.1.0 | ^8.2 | ^9.0| | MIT |
Pre-releases (1)
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v2.0.0-alpha.1 | ^8.3 | ^12.0| | MIT |