PHPackages                             dipeshsukhia/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. dipeshsukhia/laravel-html-minify

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

dipeshsukhia/laravel-html-minify
================================

laravel minify html output

v3.3.6(3mo ago)7984.8k↑13.9%23MITPHPPHP &gt;=8.1CI failing

Since Dec 15Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/dipeshsukhia/laravel-html-minify)[ Packagist](https://packagist.org/packages/dipeshsukhia/laravel-html-minify)[ Docs](https://github.com/dipeshsukhia/laravel-html-minify)[ GitHub Sponsors](https://github.com/dipeshsukhia)[ RSS](/packages/dipeshsukhia-laravel-html-minify/feed)WikiDiscussions 3.x Synced 3d ago

READMEChangelog (10)Dependencies (4)Versions (25)Used By (0)

Laravel HTML Minifier
=====================

[](#laravel-html-minifier)

[![Latest Version on Packagist](https://camo.githubusercontent.com/60a6a54871d82d9111af207f429f2003c376d458a372644643727a9c15e49c77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64697065736873756b6869612f6c61726176656c2d68746d6c2d6d696e6966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dipeshsukhia/laravel-html-minify)[![Build Status](https://camo.githubusercontent.com/1a9a5c3e54b554da6494b752659eb80cdfec9163d3c9158ff1cbfef06e72d982/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f64697065736873756b6869612f6c61726176656c2d68746d6c2d6d696e6966792f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/dipeshsukhia/laravel-html-minify)[![Quality Score](https://camo.githubusercontent.com/6ed0a58db5ade9cd723a24e304f38a08cede17d6b638599708653310762a3f5b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f64697065736873756b6869612f6c61726176656c2d68746d6c2d6d696e6966792e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/dipeshsukhia/laravel-html-minify)[![Total Downloads](https://camo.githubusercontent.com/1465ecc7e63eae185955ef87c7e1ccfe2d67f19a43b6015706e111bf2bb102bb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64697065736873756b6869612f6c61726176656c2d68746d6c2d6d696e6966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dipeshsukhia/laravel-html-minify)

This package helps to minify your project`s html (blade file) output.

### Requirements

[](#requirements)

LaravelPackage5.x to 9.x2.x&gt;= 10.x3.xInstallation
------------

[](#installation)

You can install the package via composer:

```
composer require dipeshsukhia/laravel-html-minify
```

Sponsor Laravel HTML Minifier on GitHub
---------------------------------------

[](#sponsor-laravel-html-minifier-on-github)

[Become a sponsor to Dipesh Sukhia ](https://github.com/sponsors/dipeshsukhia).

Setup
-----

[](#setup)

### Generate Config

[](#generate-config)

```
php artisan vendor:publish --tag=LaravelHtmlMinify
```

### add middleware to web middleware group within app/Http/Kernel.php

[](#add-middleware-to-web-middleware-group-within-apphttpkernelphp)

```
\DipeshSukhia\LaravelHtmlMinify\Middleware\LaravelMinifyHtml::class
```

Usage
-----

[](#usage)

### for enable in env

[](#for-enable-in-env)

```
HTML_MINIFY=true
```

### for disable in env

[](#for-disable-in-env)

```
HTML_MINIFY=false
```

### exclude route name for from minify update config

[](#exclude-route-name-for-from-minify-update-config)

```
'exclude_route' => [
        // 'routeName'
]
```

### minify particular html part

[](#minify-particular-html-part)

```
LaravelHtmlMinifyFacade::htmlMinify("...");
```

### exclude minify particular html part

[](#exclude-minify-particular-html-part)

```
LaravelHtmlMinifyFacade::excludeHtmlMinify("...");
```

### exclude html minify in blade directory

[](#exclude-html-minify-in-blade-directory)

```
@excludeMinify
     exclude code from Minify
@endExcludeMinify
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Dipesh Sukhia](https://github.com/dipeshsukhia)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

59

—

FairBetter than 98% of packages

Maintenance78

Regular maintenance activity

Popularity47

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

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

Recently: every ~92 days

Total

24

Last Release

117d ago

Major Versions

v2.0 → v3.02023-07-06

v2.1 → v3.12023-07-06

v2.2 → v3.22023-09-06

v2.3 → v3.32023-09-07

v2.3.1 → 3.x-dev2026-03-10

PHP version history (2 changes)v1.0PHP &gt;=5.5.9

v3.1PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/34036367?v=4)[Dipesh Sukhia](/maintainers/dipeshsukhia)[@dipeshsukhia](https://github.com/dipeshsukhia)

---

Top Contributors

[![dipeshsukhia](https://avatars.githubusercontent.com/u/34036367?v=4)](https://github.com/dipeshsukhia "dipeshsukhia (37 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (3 commits)")[![bhavingajjar](https://avatars.githubusercontent.com/u/11258397?v=4)](https://github.com/bhavingajjar "bhavingajjar (2 commits)")[![genericmilk](https://avatars.githubusercontent.com/u/1846127?v=4)](https://github.com/genericmilk "genericmilk (1 commits)")[![RChutchev](https://avatars.githubusercontent.com/u/11131666?v=4)](https://github.com/RChutchev "RChutchev (1 commits)")

---

Tags

dipeshsukhialaravel-html-minify

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)[illuminate/cookie

The Illuminate Cookie package.

244.6M137](/packages/illuminate-cookie)

PHPackages © 2026

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