rzl-zone/blade-minify

A Laravel package to seamlessly minify Blade HTML output for faster pages and a better user experience.

Maintainers

Package info

github.com/rzl-zone/blade-minify

pkg:composer/rzl-zone/blade-minify

Fund package maintenance!

rzl-app

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.0.3 2026-06-14 04:39 UTC

This package is auto-updated.

Last update: 2026-06-14 04:57:37 UTC


README

Latest Version on Packagist Total Downloads PHPStan PHP Laravel Illuminate Support GitHub Repo on GitHub

🚀 Automatically minifies your Laravel Blade output for smaller pages & blazing-fast load times.

🛠 Supports:

Built with ❤️ by @rzl-zone.

📚 Table of Contents

🛠 Requirements

Laravel Framework & illuminate/support PHP Package
^10.x | ^11.x | ^12.x | ^13.x ^8.2 v1.x

⚙️ Installation

You can install the package via composer:

composer require rzl-zone/blade-minify

Sponsor Rzl Laravel Blade Minifier on GitHub

Become a sponsor to Rzl App.

🚀 Setup

Publish config

php artisan vendor:publish --tag=RzlZoneBladeMinify

Add middleware to web middleware group within app/Http/Kernel.php

\RzlZone\BladeMinify\Middleware\RzlBladeOutputMinifier::class

🔥 Usage

Enable in .env

RZLZONE_MINIFY_ENABLE=true

Disable in .env

RZLZONE_MINIFY_ENABLE=false

Minify only in production

RZLZONE_MINIFY_ONLY_PROD=true

Minify at all mode APP Env (default)

RZLZONE_MINIFY_ONLY_PROD=false

Ignore specific route names from minifying render output

'ignore_route_name' => [
  // 'dashboard',
  // 'home',
]

Minify a particular Blade string manually

RzlBladeMinify::minify("<div>...</div>");

Ignoring minify a particular Blade string manually

RzlBladeMinify::excludeMinify("<div>...</div>");

Ignore minify in Blade

{{-- Blade directive to ignore minify --}}

@ignoreRzlzoneMinify
  <div> this script will ignored from minify   </div>
@endIgnoreRzlzoneMinify

Working with Vite & Laravel Boost

No special handling is required.

@viteReactRefresh
@vite(['resources/js/app.js'])

The package automatically handles Vite, React Refresh, and Laravel Boost output, ensuring they remain compatible with Blade minification out of the box.

If needed, you can still use the @ignoreRzlzoneMinify directive for custom sections that should not be processed by the minifier:

@ignoreRzlzoneMinify
    <pre>{{ $debugOutput }}</pre>
@endIgnoreRzlzoneMinify

This is entirely optional and is only recommended for custom edge cases or debugging purposes.

📝 Changelog

Please see CHANGELOG for more information what has changed recently.

🤝 Contributing

Please see CONTRIBUTING for details.

🛡 Security

Please report issues to rzlzone.dev@gmail.com.

🙌 Credits

📜 License

The MIT License (MIT). Please see License File for more information.

🔗 Framework & Reference Links

Reference URL
📝 Laravel Docs https://laravel.com/docs
🏗 Illuminate\Support https://github.com/laravel/framework/tree/13.x/src/Illuminate/Support
🐘 PHP Official https://www.php.net

Enjoy rzl-zone/blade-minify?
Leave a ⭐ on GitHub — it keeps this project thriving!

✨ From rzl-zonewhere code meets passion.