Download the PHP package enrisezwolle/image-optimizer-for-laravel without Composer
On this page you can find all versions of the php package enrisezwolle/image-optimizer-for-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package image-optimizer-for-laravel
Image optimizer for laravel
This package allows you to easily optimize images with the power of components, helper methods and facades. It allows you to easily scale images down, compress images or convert it to the webp format for performance.
Optimized images are automatically stored in a storage disk. For this you can use the default disk or use a pre-existing one. When loading an image it will first try to read the file from the storage. If a cached version does not exist it will generate a new image.
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Optionally, you can publish the views using
Usage
There are multiple ways to use this package.
View Components
This package comes with two components out of the box.
Both components accept the following 4 parameters
- src: The path to the image. This can be a relative or an absolute path.
- Quality: Optional - Default quality of 80
- width: Optional - The minimum width of the image. It will pick the closest dimension set in the config
- webp: Optional - Determines if the image should be converted to the webp format
Image
Source
Facade
This package also comes with a facade if you would rather write your own implementation.
Helper
This package also supplies a handy helpers to optimize your images.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
All versions of image-optimizer-for-laravel with dependencies
illuminate/contracts Version *
intervention/image Version ^2.0
spatie/laravel-package-tools Version ^1.16