Skip to content

Asyassin10/laravel-webp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel WebP Package

A Laravel package for WebP image conversion and optimization.

Installation

composer require yassineas/laravel-webp

Configuration

Publish the configuration file:

php artisan vendor:publish --provider="YassineAS\LaravelWebp\Providers\WebpServiceProvider"

Usage

Basic Usage

use YassineAS\LaravelWebp\Facades\Webp;

// Convert image to WebP
$webpPath = Webp::convert('/path/to/image.jpg');

// Convert with quality setting
$webpPath = Webp::convert('/path/to/image.jpg', 80);

// Convert and resize
$webpPath = Webp::convert('/path/to/image.jpg', 80, 800, 600);

Artisan Command

# Convert single image
php artisan webp:convert /path/to/image.jpg

# Convert all images in directory
php artisan webp:convert-directory /path/to/images/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages