lloricode/spatie-image-optimizer-health-check

These checks are where you can check if optimizer is installed on your server.
47,224 2
Install
composer require lloricode/spatie-image-optimizer-health-check
Latest Version:v3.0.2
PHP:^8.3
Laravel:12 · 13
Older releases:8 – 11
License:MIT
Last Updated:Jul 14, 2026
Links: GitHub  ·  Packagist
Maintainer: lloricode

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,
            Optimizer::AVIFENC,
        ]),
]);

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.

Related Packages

spatie/laravel-backup

A Laravel package to backup your application

28,869,800 6,026
spatie/laravel-permission

Permission handling for Laravel 12 and up

123,283,693 12,972
spatie/laravel-medialibrary

Associate files with Eloquent models

52,057,214 6,167
spatie/laravel-activitylog

A very simple activity logger to monitor the users of your website or applicatio...

65,490,992 5,908
spatie/laravel-fractal

An easy to use Fractal integration for Laravel applications

17,105,565 1,905

Version History

Version Released PHP Laravel License
v3.0.2 ^8.3 ^12.0|^13.0 MIT
v3.0.1 ^8.3 ^12.0|^13.0 MIT
v3.0.0 ^8.3 ^12.0|^13.0 MIT
v2.0.5 ^8.3 ^11.0|^12.0|^13.0 MIT
v2.0.4 ^8.2 ^11.0|^12.0 MIT