nevadskiy/nova-icon-picker
最新稳定版本:0.1.0
Composer 安装命令:
composer require nevadskiy/nova-icon-picker
包简介
Icon Picker for Laravel Nova.
README 文档
README
Icon Picker for Laravel Nova
✅ 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.
统计信息
- 总下载量: 6.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-24