定制 onestrive/heroicon 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

onestrive/heroicon

Composer 安装命令:

composer require onestrive/heroicon

包简介

Fork version with updated dependencies: 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 OneStrive/heroicon

Usage:

Use it as regular nova field:

use OneStrive\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 OneStrive\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 OneStrive\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 OneStrive\Heroicon\Heroicon;

Heroicon::make('Icon')->registerIconSet('custom', 'Custom', resource_path('img/icons'));

To allow certain sets of icons:

use OneStrive\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:

alex.azarsecond@gmail.com

License:

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

统计信息

  • 总下载量: 2.23k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固