nevadskiy/nova-icon-picker 问题修复 & 功能扩展

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

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

nevadskiy/nova-icon-picker

Composer 安装命令:

composer require nevadskiy/nova-icon-picker

包简介

Icon Picker for Laravel Nova.

README 文档

README

Stand With Ukraine

Icon Picker for Laravel Nova

Latest Stable Version License

Screenshot

✅ Requirements

  • Laravel Nova 4
  • PHP 8.0 or newer

🔌 Installation

Install the package via Composer:

composer require nevadskiy/nova-icon-picker

📄 Documentation

Persisting

The field simply stores icons as a string representing the icon's name.

Iconsets

To add icons to the field, use the iconset method, which accepts the name of the iconset and the path to the directory with SVG icons. It is allowed to register multiple iconsets, but it requires defining unique prefixes so that icons can be resolved correctly.

Defining Field

To add a field to a resource, simply add it to resource's fields method:

use Nevadskiy\Nova\IconPicker\IconPicker;

public function fields(): array
{
    return [
        IconPicker::make('Icon')
            ->iconset(
                name: 'General'
                path: resource_path('svg'), 
            ),
            ->iconset(
                name: 'Brands', 
                path: resource_path('svg/brands'), 
                prefix: 'brands/' 
            )
            ->indexSize(16)
            ->detailSize(32),
    ]
}

Global configuration

It is also possible to configure the field via ServiceProvider:

public function boot(): void
{
    IconPicker::configure(function (IconPicker $icon) {
        $icon->iconset(
            name: 'Solid',
            path: resource_path('svg/solid'),
            prefix: 'solid/',
        );
    
        $icon->iconset(
            name: 'Outline',
            path: resource_path('svg/outline'),
            prefix: 'outline/',
        );
    
        $icon->iconset(
            name: 'Brands',
            path: resource_path('svg/brands'),
            prefix: 'brands/',
        );
    });
}

📜 License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固