alexazartsev/heroicon
Composer 安装命令:
composer require alexazartsev/heroicon
包简介
A Laravel Nova field for managing icons.
关键字:
README 文档
README
A Laravel Nova Field for managing icons. Heroicons and free Font Awesome supported out of the box, pro version of Font Awesome can be registered as custom set of icons.
Custom sets of icons can be registered globally for each field or locally for concrete field instanse and used with or instead default sets.
Each icon can be changed via editor.
Icon saved as svg html tag into db.
Installation:
Use composer for installation. Laravel with nova required.
composer require alexazartsev/heroicon
Usage:
Use it as regular nova field:
use AlexAzartsev\Heroicon\Heroicon; Heroicon::make('Icon');
Default icon sets available:
| Name | Label | Icons |
|---|---|---|
| solid | Heroicons solid | Heroicons solid |
| outline | Heroicons outline | Heroicons outline |
| fa-brands | Font Awesome brands | Font Awesome brands |
| fa-solid | Font Awesome solid | Font Awesome solid |
| fa-regular | Font Awesome regular | Font Awesome regular |
To use custom or customize existing icon click on Edit button and just edit svg code of selected icon:
To register custom set of icons use global or local configuration discribed below:
Configuration:
Global configuration:
Field can be configured globally in NovaServiceProvider:
namespace App\Providers; use AlexAzartsev\Heroicon\Heroicon; class NovaServiceProvider extends NovaApplicationServiceProvider { ... public function boot() { parent::boot(); // to register set of icons globally, just specify folder with svg icons like this: // (icons should be located directly in specified folder in .svg format) // 'custom' icon set will be available for every Heroicon in your app Heroicon::registerGlobalIconSet('custom', 'Custom Icons', resource_path('img/icons')); // to pick default icon sets that will be available on field all over app use this: // default sets available: 'solid', 'outline', 'fa-brands', 'fa-regular', 'fa-solid' Heroicon::defaultIconSets(['solid', 'fa-brands', 'custom']); // to make svg editor disabled by default for every field use this: Heroicon::defaultEditorEnable(false); }
Local configuration:
To disable or enable svg editor of the icon:
use AlexAzartsev\Heroicon\Heroicon; Heroicon::make('Icon')->disableEditor(); Heroicon::make('Icon')->enableEditor();
To register custom set of icons (icons should be located directly in specified folder in .svg format):
use AlexAzartsev\Heroicon\Heroicon; Heroicon::make('Icon')->registerIconSet('custom', 'Custom', resource_path('img/icons'));
To allow certain sets of icons:
use AlexAzartsev\Heroicon\Heroicon; Heroicon::make('Icon')->only(['custom', 'solid']); //for default sets you can use these methods: Heroicon::make('Icon')->onlySolid(); Heroicon::make('Icon')->onlyOutline(); Heroicon::make('Icon')->onlyFaBrands(); Heroicon::make('Icon')->onlyFaSolid(); Heroicon::make('Icon')->onlyFaRegular();
Support:
License:
The MIT License (MIT). Please see License File for more information.
alexazartsev/heroicon 适用场景与选型建议
alexazartsev/heroicon 是一款 基于 Vue 开发的 Composer 扩展包,目前已累计 130.6k 次下载、GitHub Stars 达 10, 最近一次更新时间为 2021 年 03 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「nova」 「laravel」 「svg」 「Heroicons」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 alexazartsev/heroicon 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 alexazartsev/heroicon 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 alexazartsev/heroicon 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova card that shows you your system information.
A Laravel Nova card.
PHP class to add Font Awesome 5+'s SVG icons inline without Javascript.
A Laravel Nova package for publishable fields
Utility functions to inline SVGs in PHP Projects
A Laravel Nova package for translatable fields
统计信息
- 总下载量: 130.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-03-12