A Laravel package that minifies HTML, CSS, and JavaScript responses and Blade templates at compile time.
Laravel HTMLMin is a PHP package for the Laravel framework that minifies HTML, CSS, and JavaScript output to reduce bandwidth usage and improve website performance. It works by compressing Blade templates at compile time and can also minify entire HTTP responses via middleware.
Laravel developers looking to optimize their application's frontend performance by reducing HTML, CSS, and JavaScript file sizes without manual minification steps.
Developers choose Laravel HTMLMin for its seamless integration with Laravel's Blade engine, offering both cached compile-time minification and flexible runtime minification via middleware, all configurable to avoid breaking existing templates.
A simple HTML minifier for Laravel 5, 6, 7, 8 & 9.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Minifies Blade templates during compilation and caches optimized versions, minimizing runtime overhead as the README notes it has 'little impact on php processing time'.
Offers both compile-time optimization for performance and middleware-based runtime minification for maximal compression, providing flexibility as described in the usage section.
Allows specifying ignore paths or using HTML comments like <!-- skip.minification --> to exclude files, preventing issues with sensitive or problematic templates as per the configuration.
Leverages Mr Clay's Minify package for CSS and JavaScript compression, a well-established tool ensuring reliable minification of inline and external code.
The middleware minifies responses on each request, which the README explicitly warns has 'a performance cost' compared to compile-time only minification.
Force mode for blade optimization can cause issues with complex views, and the package cautions it 'should only be used if you are fully aware of the potential issues,' indicating a real danger.
Requires running `php artisan view:clear` to see changes after minification, adding an extra step in development and deployment workflows, as noted in the README.
The README lists support up to Laravel 8.x, so it may not be compatible with newer versions without updates, potentially lagging behind framework advancements.