helgesverre/blade-heroicons-upgrader
Composer 安装命令:
composer require helgesverre/blade-heroicons-upgrader
包简介
Automatically upgrade Heroicons v1 to v2 icon names in Blade templates
README 文档
README
Blade Heroicons Upgrader
Storytime.
What it does.
This only supports Blade Heroicons.
🔧 Blade Heroicons Upgrader is a Laravel tool specifically designed for updating from Heroicons v1 to v2 in Blade files. It simplifies the process of transitioning to the latest Blade Heroicons version, making it quick and effortless.
This tool replaces old icon names in your code, such as @svg("clipboard-check") and <x-clipboard-check />, and
updates them to their new v2 equivalents such as @svg("clipboard-document-check")
and <x-clipboard-document-check />.
It's built to prevent overlapping or incorrect updates, ensuring that icons are not mistakenly transformed into
something
like <x-heroicon-o-server-stack-stack />.
Requirements
- PHP: 8.1 or higher
- Laravel: 10.17+, 11.x, or 12.x
- Laravel 10.17+ is required due to the
laravel/promptsdependency
- Laravel 10.17+ is required due to the
Installation
You can install the package via composer:
composer require --dev helgesverre/blade-heroicons-upgrader
Usage
Run the command to upgrade your blade files (defaults to ./resources/views):
php artisan blade-heroicons-upgrader:upgrade
You can target a specific file or directory by passing it as an argument:
php artisan blade-heroicons-upgrader:upgrade resources/views/welcome.blade.php
You may also specify one or more files or directories:
php artisan blade-heroicons-upgrader:upgrade ./resources/views ./app/Composers/MenuComposer.php
You can do a dry run to preview replacements without modifying files:
php artisan blade-heroicons-upgrader:upgrade --dry
Development
Running Tests
# Run test suite composer test # Run tests with coverage (requires Xdebug or uses Herd) composer test-coverage # Run static analysis composer analyse # Format code composer format
Testing Installation Across Laravel Versions
To test the package installation works correctly across Laravel 10, 11, and 12:
# Bash version (recommended for quick testing) composer test-install # PHP version (better error handling, more maintainable) composer test-install:php # Or run scripts directly bash test-install.sh php test-install.php
Both scripts will:
- Test Laravel 10, 11, and 12 installations
- Create fresh Laravel projects in
wip/laravel-*directories - Install the package from the local codebase
- Verify the command is registered
- Test command execution with a sample file
- Continue testing all versions even if one fails
- Show a summary with passed/failed versions
- Exit with code 1 if any version fails (useful for CI)
Key Improvements:
- Tests continue even if Laravel 9 fails (it's not supported)
- Summary table shows which versions passed/failed
- Only creates directories for successfully installed versions
To clean up test installations: rm -rf wip
FAQ
Q: Does it work for other icon sets? A: No, maybe in the future
Q: My icon was replaced with the wrong one. What should I do? A: If you encounter any incorrect replacements, Please submit a pull request with the correction. Your help in would be greatly appreciated!
Q: Why did you build this? A: I had to do this process manually 4 times this year, and was tired of doing it.
License
The MIT License (MIT). Please see License File for more information.
helgesverre/blade-heroicons-upgrader 适用场景与选型建议
helgesverre/blade-heroicons-upgrader 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 503 次下载、GitHub Stars 达 19, 最近一次更新时间为 2023 年 12 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「helgesverre」 「Heroicons」 「blade-icons」 「blade-heroicons-upgrader」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 helgesverre/blade-heroicons-upgrader 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 helgesverre/blade-heroicons-upgrader 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 helgesverre/blade-heroicons-upgrader 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Fork version with updated dependencies: A Laravel Nova field for managing icons.
Latest v 1.x Heroicons package
Laravel SDK for Brandfetch
Heroicons selection field for MoonShine
Symfony form type for icon selection: direct selector and search. Integrates with Symfony UX Icons (Heroicons, Bootstrap Icons, etc.). Stores icon identifier as string.
A beautiful icon picker field for FilamentPHP v5 with support for Heroicons, Lucide and more
统计信息
- 总下载量: 503
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 19
- 点击次数: 26
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-30