rzl-app/laravel-blade-minify 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rzl-app/laravel-blade-minify

最新稳定版本:v1.2.2

Composer 安装命令:

composer require rzl-app/laravel-blade-minify

包简介

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

README 文档

README

Latest Version on Packagist Total Downloads PHPStan PHP Laravel Illuminate Support

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

🛠 Supports:

Built with ❤️ by @rzl-app.

📚 Table of Contents

🛠 Requirements

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

⚙️ Installation

You can install the package via composer:

composer require rzl-app/laravel-blade-minify

Sponsor Rzl Laravel Blade Minifier on GitHub

Become a sponsor to Rzl App .

🚀 Setup

Publish config

php artisan vendor:publish --tag=RzlLaravelBladeMinify

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

\RzlApp\BladeMinify\Middleware\RzlBladeMinify::class

🔥 Usage

Enable in .env

RZL_MINIFY_ENABLE=true

Disable in .env

RZL_MINIFY_ENABLE=false

Minify only in production

RZL_MINIFY_ONLY_PROD=true

Minify at all mode APP Env (default)

RZL_MINIFY_ONLY_PROD=false

Ignore specific route names from minifying render output

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

Minify a particular Blade string manually

RzlBladeMinifyFacade::bladeMinify("<div>...</div>");

Ignoring minify a particular Blade string manually

RzlBladeMinifyFacade::excludeBladeMinify("<div>...</div>");

Ignore minify in Blade

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

@ignoreMinify
  <div> this script will ignored from minify   </div>
@endIgnoreMinify

Working with vite directive

At dev mode you can do:

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

@ignoreMinify
  @viteReactRefresh
@endIgnoreMinify

Or add to your providers.php:

// bootstrap/providers.php

return [
  RzlApp\BladeMinify\Providers\ViteCustomProvider::class,
  // .... other you provider class...
];

📝 Changelog

Please see CHANGELOG for more information what has changed recently.

🤝 Contributing

Please see CONTRIBUTING for details.

🛡 Security

Please report issues to rizalvindwiky@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/12.x/src/Illuminate/Support
🐘 PHP Official https://www.php.net

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

✨ From rzl-appwhere code meets passion.

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-18