PHPackages                             nckg/laravel-minify-html - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nckg/laravel-minify-html

AbandonedLibrary[Utility &amp; Helpers](/categories/utility)

nckg/laravel-minify-html
========================

Minify your responses in Laravel 5.x

1.4.0(5y ago)1339.3k↓34.4%6[2 issues](https://github.com/nckg/laravel-minify-html/issues)1MITPHPPHP ^7.0 || ^8.0CI failing

Since Sep 26Pushed 5y ago3 watchersCompare

[ Source](https://github.com/nckg/laravel-minify-html)[ Packagist](https://packagist.org/packages/nckg/laravel-minify-html)[ RSS](/packages/nckg-laravel-minify-html/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (4)Versions (11)Used By (1)

HTML minifier
=============

[](#html-minifier)

[![Build Status](https://camo.githubusercontent.com/9e96a2b8cfd24bf72d4f32f4204c4fe8e90205050f29897239f7c3fd9aec2b77/68747470733a2f2f7472617669732d63692e6f72672f6e636b672f6c61726176656c2d6d696e6966792d68746d6c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nckg/laravel-minify-html) [![Packagist](https://camo.githubusercontent.com/726ced2ad13198769b9e86479d5d70bd45d2c7daa6b3cef2f6de98ae0764c780/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e636b672f6c61726176656c2d6d696e6966792d68746d6c2e7376673f6d61784167653d323539323030303f7374796c653d666c61742d737175617265)](https://github.com/nckg/laravel-minify-html) [![Packagist](https://camo.githubusercontent.com/9d357f0eda5aae0fc40a8d338021783b68aab01357957d1a4c34ece7059e3cdc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e636b672f6c61726176656c2d6d696e6966792d68746d6c2e7376673f6d61784167653d323539323030303f7374796c653d666c61742d737175617265)](https://github.com/nckg/laravel-minify-html) [![codecov](https://camo.githubusercontent.com/2dbad880bd7e754c23d4d8d71be0737f14a58a2fab6882167d41dfb599a2aa3f/68747470733a2f2f636f6465636f762e696f2f67682f6e636b672f6c61726176656c2d6d696e6966792d68746d6c2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/nckg/laravel-minify-html)

Introduction
------------

[](#introduction)

Very, very simple html minifier with Laravel 5.x support.

It *minifies* HTML by

1. removing HTML comments except IE conditions
2. removing comments
3. shorten multiple white spaces
4. removing whitespaces between HTML tags
5. collapsing new lines

You should end up with a small size profit:

UniminfiedMinified64.2KB44.6KBCode Samples
------------

[](#code-samples)

```
$input = "Hello World";
$minifier = new Minifier();
$output = $minifier->html($string); // Hello World
```

Installation
------------

[](#installation)

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,
];
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

The MIT License (MIT).

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 84.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~265 days

Recently: every ~362 days

Total

7

Last Release

1931d ago

PHP version history (2 changes)1.0.0PHP ^7.0

1.4.0PHP ^7.0 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/360602?v=4)[Nick Goris](/maintainers/nckg)[@nckg](https://github.com/nckg)

---

Top Contributors

[![nckg](https://avatars.githubusercontent.com/u/360602?v=4)](https://github.com/nckg "nckg (11 commits)")[![ibrunotome](https://avatars.githubusercontent.com/u/4256471?v=4)](https://github.com/ibrunotome "ibrunotome (1 commits)")[![mezhevikin](https://avatars.githubusercontent.com/u/973364?v=4)](https://github.com/mezhevikin "mezhevikin (1 commits)")

---

Tags

html-minifierlaravelmiddlewareminifierphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nckg-laravel-minify-html/health.svg)

```
[![Health](https://phpackages.com/badges/nckg-laravel-minify-html/health.svg)](https://phpackages.com/packages/nckg-laravel-minify-html)
```

###  Alternatives

[based/momentum-modal

Build dynamic modal dialogs for your Inertia-powered Laravel apps

462427.3k1](/packages/based-momentum-modal)[backpack/settings

Application settings interface for Laravel 5 using Backpack CRUD.

290870.9k10](/packages/backpack-settings)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
