Skip to content

1.5.1

Latest
Compare
Choose a tag to compare
@olivervogel olivervogel released this 15 Feb 07:17
c92241c

What's Changed

The package now includes a Laravel response macro that can be used to elegantly encode image resources and convert it to an HTTP response in a single step.

Example

use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Storage;
use Intervention\Image\Format;
use Intervention\Image\Laravel\Facades\Image;

Route::get('/', function () {
    $image = Image::read(Storage::get('example.jpg'))
        ->scale(height: 300);

    return response()->image($image, Format::WEBP, quality: 65);
});

Full Changelog: 1.4.0...1.5.0