定制 bugo/moonshine-heroicons-field 二次开发

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

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

bugo/moonshine-heroicons-field

最新稳定版本:2.0

Composer 安装命令:

composer require bugo/moonshine-heroicons-field

包简介

Heroicons selection field for MoonShine

README 文档

README

PHP Coverage Status

Convenient Heroicons selection field for MoonShine

Support MoonShine versions

MoonShine This package
2.0+ 0.x
3.0+ 1.x
4.0+ 2.x

Installation

composer require bugo/moonshine-heroicons-field

Configuration

You can specify desired default style for icons:

.env:

HEROICONS_STYLE=outline

config/heroicons-field.php:

php artisan vendor:publish --tag=heroicons-field
/*
 * Possible values:
 * 's', 'solid' - Solid 24x24, Solid fill
 * 'o', 'outline' - Outline 24x24, 1.5px stroke
 * 'm', 'mini' - Mini 20x20, Solid fill
 * 'c', 'micro' - Micro 16x16, Solid fill
 */
return [
    'style' => env('HEROICONS_STYLE', 'solid'),
];

Usage

You can use IconSelect field in your resources:

<?php

declare(strict_types=1);

namespace App\MoonShine\Resources;

use Bugo\MoonShine\Heroicons\Fields\IconSelect;
use MoonShine\Laravel\Resources\ModelResource;
use MoonShine\Contracts\UI\FieldContract;
use MoonShine\Contracts\UI\ComponentContract;

/**
 * @extends ModelResource<Custom>
 */
class CustomResource extends ModelResource
{
    /**
     * @return list<ComponentContract|FieldContract>
     */
    protected function formFields(): iterable
    {
        return [
            IconSelect::make('Icon')
                ->searchable()
                ->useStyle('mini'),
        ];
    }
}

All use cases of Blade Heroicons are also available for you.

Caching

When using icons in Blade templates, be sure to enable Caching.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-20