<?php
namespace Buglinjo\LaravelWebp;
use Buglinjo\LaravelWebp\Exceptions\DriverIsNotSupportedException;
use Illuminate\Support\Facades\Config;
use Illuminate\Http\UploadedFile;
class Webp
{
/**
* @param UploadedFile $image
* @return Cwebp|PhpGD|Traits\WebpTrait|null
* @throws DriverIsNotSupportedException
*/
public static function make(UploadedFile $image)
{
$driver = Config::get('laravel-webp.default_driver');
$availableDrivers = Config::get('laravel-webp.drivers');
if (!in_array($driver, array_keys($availableDrivers))) {
throw new DriverIsNotSupportedException($driver);
}
switch ($driver) {
case 'php-gd':
return (new PhpGD())->make($image);
case 'cwebp':
return (new Cwebp())->make($image);
}
return null;
}
}
How To Payment
Making a payment on our website is quick and secure. Start by logging in or creating an account. Select your preferred payment method, input the required details, and review the information. Once you confirm everything is correct, click on the "Submit Payment" button. You’ll receive instant confirmation and can track your payment status through your account dashboard. It’s an easy and secure process.