signdeer / laravel-html-minify
laravel minify html output
Fund package maintenance!
dipeshsukhia
Requires
- php: >=8.1
- illuminate/support: ^10.0|^11.0|^12.0
Requires (Dev)
- phpunit/phpunit: ^10.5
This package is not auto-updated.
Last update: 2025-07-15 22:16:28 UTC
README
This package helps to minify your project`s html (blade file) output.
Requirements
Laravel | Package |
---|---|
5.x to 9.x | 2.x |
>= 10.x | 3.x |
Installation
You can install the package via composer:
composer require signdeer/laravel-html-minify
Setup
Generate Config
php artisan vendor:publish --tag=LaravelHtmlMinify
add middleware to web middleware group within app/Http/Kernel.php
\DipeshSukhia\LaravelHtmlMinify\Middleware\LaravelMinifyHtml::class
Usage
for enable in env
HTML_MINIFY=true
for disable in env
HTML_MINIFY=false
exclude route name for from minify update config
'exclude_route' => [ // 'routeName' ]
minify particular html part
LaravelHtmlMinifyFacade::htmlMinify("<div>...</div>");
exclude minify particular html part
LaravelHtmlMinifyFacade::excludeHtmlMinify("<div>...</div>");
exclude html minify in blade directory
@excludeMinify <div> exclude code from Minify </div> @endExcludeMinify
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please mungai@signdeer.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.