Laravel Optimizer runs a series of optimizations on your Laravel project. It helps you optimize your web app before/during deployment and make it faster. The package will help you reduce your website images sizes, run the usual Laravel deployment commands, minify HTML output, and run further optimizations using PHP Opcache.
You can install the package via composer:
composer require bandughana/laravel-optimizer
Then, run the following Artisan command to set up the package and publish configurations:
php artisan optimizer:install
Behind the scenes, this package uses these awesome packages: Laravel Opcache, Laravel Image Optimizer, and Laravel Page Speed. Configurations for each of the packages will be published to your project's config
folder after running the above command. For further package-specific configurations, consult the docs for these packages.
In the root of your project, you can run optimizations using the Artisan command:
php artisan optimizer:run
If you set reversible
to true
in config/laravel-optimizer.php
before running the above command, you can reverse the optimizations by running the Artisan command below:
php artisan optimizer:revert
You can choose to reverse all optimizations, only image optimizations, or only code optimizations by specifying a --t|type
(-t
or --type
) flag with the value of one of the following: [all
, images
, code
]. If you don't provide a value to this option, you'll be promted to choose one.
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email alhassankamil10@gmail.com instead of using the issue tracker.
This package uses the MIT License (MIT). Please see License File for more information.
Bandughana is a Ghanaian software solutions provider. Our team loves to contribute
to open source.
Proudly made by