PHPackages                             fitztrev/laravel-html-minify - 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. [Templating &amp; Views](/categories/templating)
4. /
5. fitztrev/laravel-html-minify

ActiveLibrary[Templating &amp; Views](/categories/templating)

fitztrev/laravel-html-minify
============================

Minifies the HTML output of Laravel 4 applications

1.0.3(11y ago)414211.4k↓22.1%44[10 issues](https://github.com/fitztrev/laravel-html-minify/issues)[2 PRs](https://github.com/fitztrev/laravel-html-minify/pulls)MITPHP

Since Feb 3Pushed 10y ago20 watchersCompare

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

READMEChangelogDependencies (4)Versions (5)Used By (0)

UPDATE for Laravel 5/5.1+
-------------------------

[](#update-for-laravel-551)

Read my preferred way of minifying HTML in Laravel 5/5.1+ apps here: [Using Gulp to Minify Laravel Blade Templates](https://github.com/fitztrev/laravel-html-minify/wiki/Laravel-5---5.1-HTML-Minifying)

---

Laravel HTML Minify
===================

[](#laravel-html-minify)

### For Laravel 4 - See [here](https://github.com/fitztrev/laravel-html-minify/wiki/Laravel-5---5.1-HTML-Minifying) for L5+

[](#for-laravel-4---see-here-for-l5)

[![Build Status](https://camo.githubusercontent.com/8cbfeb5a68bfb3af3140fd183c00cde0c9bb8e3f3919ecc09c8394bb2d3b6f0c/68747470733a2f2f7472617669732d63692e6f72672f6669747a747265762f6c61726176656c2d68746d6c2d6d696e6966792e706e67)](https://travis-ci.org/fitztrev/laravel-html-minify)[![Total Downloads](https://camo.githubusercontent.com/9db452ff1b70690771b0ff10acea87b213f927a588d7a20c96e84573a757395f/68747470733a2f2f706f7365722e707567782e6f72672f6669747a747265762f6c61726176656c2d68746d6c2d6d696e6966792f646f776e6c6f6164732e706e67)](https://packagist.org/packages/fitztrev/laravel-html-minify)

About
-----

[](#about)

This package compresses the HTML output from your Laravel 4 application, seamlessly reducing the overall response size of your pages.

Other scripts that I've seen will compress the HTML output on-the-fly for each request. Instead, this package extends the Blade compiler to save the compiled template files to disk in their compressed state, reducing the overhead for each request.

Why?
----

[](#why)

Even with gzip enabled, there is still an improvement in the response size for HTML content-type documents.

Test Pagew/o Gzipw/ Gzipw/ Gzip + Laravel HTML Minify**\#1**8,039 bytes1,944 bytes**1,836 bytes** (5.6% improvement)**\#2**377,867 bytes5,247 bytes**4,314 bytes** (17.8% improvement)Installation
------------

[](#installation)

1. Add `"fitztrev/laravel-html-minify": "1.*"` to **composer.json**.
2. Run `composer update`
3. Add `Fitztrev\LaravelHtmlMinify\LaravelHtmlMinifyServiceProvider` to the list of providers in **app/config/app.php**.
4. **Important:** You won't see any changes until you edit your `*.blade.php` template files. Once Laravel detects a change, it will recompile them, which is when this package will go to work. To force all views to be recompiled, just run this command: `find . -name "*.blade.php" -exec touch {} \;`

Config
------

[](#config)

Optionally, you can choose to customize how the minifier functions for different environments. Publish the configuration file and edit accordingly.

```
$ php artisan config:publish fitztrev/laravel-html-minify

```

### Options

[](#options)

- **`enabled`** - *boolean*, default **true**

If you are using a javascript framework that conflicts with Blade's tags, you can change them.

- **`blade.contentTags`** - *array*, default `{{` and `}}`
- **`blade.escapedContentTags`** - *array*, default `{{{` and `}}}`

#### Skipping minification

[](#skipping-minification)

To prevent the minification of a view file, add `skipmin` somewhere in the view.

```
{{-- skipmin --}}

```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 92.2% 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 ~7 days

Total

3

Last Release

4326d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e335f6525d771af23ad9d80e451163e62239e087abffda9e2071c3d8573bfc5f?d=identicon)[fitztrev](/maintainers/fitztrev)

---

Top Contributors

[![fitztrev](https://avatars.githubusercontent.com/u/271432?v=4)](https://github.com/fitztrev "fitztrev (47 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")[![blazeworx](https://avatars.githubusercontent.com/u/4718238?v=4)](https://github.com/blazeworx "blazeworx (1 commits)")[![fabioluciano](https://avatars.githubusercontent.com/u/499057?v=4)](https://github.com/fabioluciano "fabioluciano (1 commits)")[![thomaswelton](https://avatars.githubusercontent.com/u/678372?v=4)](https://github.com/thomaswelton "thomaswelton (1 commits)")

---

Tags

laravelperformancehtmlminifyminifierbladecompressoptimizationL4

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[yocmen/html-minify

Minifies the HTML output of Laravel 5 applications (Originally from https://github.com/fitztrev/laravel-html-minify)

1713.7k](/packages/yocmen-html-minify)[nochso/html-compress-twig

Twig extension for compressing HTML and inline CSS/Javascript

84468.6k8](/packages/nochso-html-compress-twig)[ken/blade-minify

Laravel Blade Minify

128.9k1](/packages/ken-blade-minify)[ogheo/yii2-htmlcompress

Compress HTML output into a single line

20184.4k1](/packages/ogheo-yii2-htmlcompress)

PHPackages © 2026

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