Skip to content

These checks are where you can check if optimizer is installed on your server.

License

Notifications You must be signed in to change notification settings

lloricode/spatie-image-optimizer-health-check

Repository files navigation

Spatie Image Optimizer Health Check

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads codecov

When using laravel-medialibrary it uses image-optimizer under the hood, and probably this would not work if optimizer tools is not installed on you server. These checks are where you can check if optimizer is installed on your server.

Installation

You can install the package via composer:

composer require lloricode/spatie-image-optimizer-health-check

Usage

use Lloricode\SpatieImageOptimizerHealthCheck\ImageOptimizerCheck;
use Spatie\Health\Facades\Health;

# all optimizer
Health::checks([
    ImageOptimizerCheck::new(),
]);

# specific optimizer
use Lloricode\SpatieImageOptimizerHealthCheck\Optimizer;

Health::checks([
    ImageOptimizerCheck::new()
        ->addChecks(Optimizer::JPEGOPTIM),
]);

# multiple
Health::checks([
    ImageOptimizerCheck::new()
        ->addChecks([
            Optimizer::JPEGOPTIM,
            Optimizer::OPTIPNG,
            Optimizer::PNGQUANT,
            Optimizer::SVGO,
            Optimizer::GIFSICLE,
            Optimizer::WEBP,
        ]),
]);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.