Downloads
Stars
Version
A package that offers a command for image optimization using spatie/image-optimizer under the hood.
The package will use these optimizers if they are present on your system:
Here's how to install all the optimizers on Ubuntu/Debian:
sudo apt-get install jpegoptim
sudo apt-get install optipng
sudo apt-get install pngquant
sudo npm install -g svgo
sudo apt-get install gifsicle
sudo apt-get install webp
sudo apt-get install libavif-bin # minimum 0.9.3
And here's how to install the binaries on MacOS (using Homebrew):
brew install jpegoptim
brew install optipng
brew install pngquant
npm install -g svgo
brew install gifsicle
brew install webp
brew install libavif
And here's how to install the binaries on Fedora/RHEL/CentOS:
sudo dnf install epel-release
sudo dnf install jpegoptim
sudo dnf install optipng
sudo dnf install pngquant
sudo npm install -g svgo
sudo dnf install gifsicle
sudo dnf install libwebp-tools
sudo dnf install libavif-tools
I recommend you use this package in local environment only, even if it is possible to use it in production environment, it is not recommended to use it in production.
You can install the package via composer:
composer require abdelhamiderrahmouni/image-optimizer-command --dev
You can publish the config file with:
php artisan vendor:publish --tag="image-optimizer-command-config"
This is the contents of the published config file:
return [
/*
* The path to the assets folder. Default is public/assets.
*/
'assets_path' => 'public/assets',
];
php artisan images:compress [path/to/assets]
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.