Package Data | |
---|---|
Maintainer Username: | nckg |
Maintainer Contact: | nickgoris@gmail.com (Nick Goris) |
Package Create Date: | 2016-09-26 |
Package Last Update: | 2021-02-02 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-22 03:12:39 |
Package Statistics | |
---|---|
Total Downloads: | 33,070 |
Monthly Downloads: | 475 |
Daily Downloads: | 27 |
Total Stars: | 14 |
Total Watchers: | 4 |
Total Forks: | 6 |
Total Open Issues: | 2 |
Very, very simple html minifier with Laravel 5.x support.
It minifies HTML by
You should end up with a small size profit:
| Uniminfied | Minified | |------------|----------| | 64.2KB | 44.6KB |
$input = "<a href="/foo" class="bar moo ">Hello World</a>";
$minifier = new Minifier();
$output = $minifier->html($string); // <a href="/foo" class="bar moo ">Hello World</a>
You can install the package via composer:
composer require nckg/laravel-minify-html
If you are using Laravel you can add the middleware to your middleware providers
// app/Http/Kernel.php
/**
* The application's global HTTP middleware stack.
*
* @var array
*/
protected $middleware = [
...
\Nckg\Minify\Middleware\MinifyResponse::class,
];
composer test
The MIT License (MIT).