Optimize Images
, (*1)
Artisan command for Laravel 4 to optimize your images using jpegoptim and optipng., (*2)
Note: Based on and inspired by Spir/ImageOptimize., (*3)
Installation
Require this package with composer:, (*4)
composer require paramonovav/laravel-optimize-images
After updating composer, add the ServiceProvider to the providers array in app/config/app.php, (*5)
'Paramonovav\LaravelOptimizeImages\LaravelOptimizeImagesServiceProvider',
You need to publish the config from this package., (*6)
php artisan config:publish paramonovav/laravel-optimize-images
Installation "jpegoptim" and "optipng" on MacOS X
Installing with brew, (*7)
brew install jpegoptim optipng
Installation "jpegoptim" and "optipng" on CentOS with yum
Installing with yum package manager, (*8)
yum install jpegoptim optipng -y
Now you can run artisan command:, (*9)
php artisan optimize:images
Note: Be CAREFUL optimized images override/replace the original images, (*10)