alimi7372 / webp-convertor
A utility Laravel package to convert images to WebP format
v1.1.2
2025-07-27 11:50 UTC
Requires
- php: >=7.4
- illuminate/support: ^8.0|^9.0|^10.0|^11.0|^12.0
- intervention/image: ^3.9
Requires (Dev)
- orchestra/testbench: ^8.18
- phpunit/phpunit: ^9.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This package allows you to convert images to WebP format and reduce their file size in your Laravel application.
Installation
You can install the package via composer:
composer require yourname/laravel-webp
Usage
To convert an image to WebP format, use the following:
use Alimi7372\Webp\WebpService; app('webp')->convert($imagePath, $outputPath);
Running Tests
To run the tests for this package, simply use:
composer test
Facade Usage
This package includes a Facade for easier usage. You can use the WEBP::convert() method to convert images to WebP format.
Example:
use Alimi7372\Webp\Facades\WebpFacade as WEBP; WEBP::convert($imagePath, $outputPath, 75);
Helpers
This package includes a helper function convert_to_webp to simplify the conversion of images to WebP format:
convert_to_webp($imagePath, $outputPath, 75);