定制 pekhota/nova-hugerte 二次开发

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

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

pekhota/nova-hugerte

最新稳定版本:v1.2.1

Composer 安装命令:

composer require pekhota/nova-hugerte

包简介

Nova HugeRTE – a self-hosted TinyMCE-compatible editor field

README 文档

README

Hero

Introduction

Based on murdercode/Nova4-TinymceEditor, HugeRTE is a license-free rich text editor field for Laravel Nova.

Screenshots

Active Editor

Once activated, the full TinyMCE-based HugeRTE editor mounts in place.
Screenshot

Lazy Mode

Editor loads only when clicked, improving performance on forms with many editors.
Screenshot

Features

  • Lazy loading support (configurable) → improves performance by mounting editors only on demand.
  • Click-to-enable overlay with smooth transition.
  • Dark mode support (auto or manual).
  • Configurable TinyMCE init, plugins, and toolbar options.
  • Can be disabled via readonly().

Prerequisites

  • Laravel >= 9
  • PHP >= 8.0
  • Laravel Nova >= 5

Installation

composer require pekhota/nova-hugerte

Then publish the config:

php artisan vendor:publish --provider="Pekhota\NovaHugeRTE\FieldServiceProvider"

This will create config/nova-hugerte.php:

<?php

return [
    /**
     * Default skin to use.
     */
    'skin' => 'oxide-dark',

    /**
     * Whether to enable lazy mode by default.
     * Lazy mode shows a textarea with overlay until activated,
     * reducing initial page load when multiple editors are present.
     */
    'lazy' => false,

    /**
     * HugeRTE init options.
     * The default options to send to the editor.
     * See https://github.com/hugerte/hugerte and https://www.tiny.cloud/docs/configure/ 
     * for all available options.
     */
    'init' => [
        'menubar' => false,
        'autoresize_bottom_margin' => 40,
        'branding' => false,
        'image_caption' => true,
        'paste_as_text' => true,
        'autosave_interval' => '20s',
        'autosave_retention' => '30m',
        'browser_spellcheck' => true,
        'contextmenu' => false,
    ],
    'plugins' => [
        'advlist',
        'anchor',
        'autolink',
        'autosave',
        'fullscreen',
        'lists',
        'link',
        'image',
        'media',
        'table',
        'code',
        'wordcount',
        'autoresize',
    ],
    'toolbar' => [
        'undo redo restoredraft | h2 h3 h4 |
         bold italic underline strikethrough blockquote removeformat |
         align bullist numlist outdent indent | image link anchor table |
         code fullscreen spoiler',
    ],
];

Usage

In your Nova/Resource.php add the field:

<?php

use Pekhota\NovaHugeRTE\HugeRTE;

class Article extends Resource
{
    public function fields(NovaRequest $request)
    {
        return [
            HugeRTE::make(__('Content'), 'content')
                ->rules(['required', 'min:20'])
                ->fullWidth()
                ->help(__('The content of the article.')),
        ];
    }
}

Lazy vs Eager Mode

  • Eager mode (default): Always mount the editor immediately:
  • Lazy mode: Shows a textarea with overlay until clicked. Best for performance with many fields. To enable, set in config
'lazy' => true,

or per field

HugeRTE::make('Content')->withMeta(['options' => ['lazy' => true]]);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固