interaction-design-foundation/nova-html-code-field 问题修复 & 功能扩展

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

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

interaction-design-foundation/nova-html-code-field

最新稳定版本:2.2.0

Composer 安装命令:

composer require interaction-design-foundation/nova-html-code-field

包简介

A Laravel Nova field to write raw HTML and preview.

README 文档

README

Latest Stable Version Total Downloads

A Laravel Nova field that provides a powerful HTML code editor with real-time preview capabilities. Write raw HTML and see instant results, with the preview rendered in an isolated iframe to prevent style conflicts with Nova's UI.

Nova HTML Code Field Demo

Features

  • Real-time HTML preview
  • Isolated preview environment using iframes
  • Custom CSS injection support
  • Customizable preview template
  • Compatible with Laravel Nova 4.x and 5.x

Installation

You can install the package via composer:

composer require interaction-design-foundation/nova-html-code-field

The package will automatically register its service provider.

Usage

Basic Usage

use InteractionDesignFoundation\NovaHtmlCodeField\HtmlCode;

public function fields(NovaRequest $request): array
{
    return [
        HtmlCode::make('HTML Content', 'content'),
    ];
}

Advanced Usage

use InteractionDesignFoundation\NovaHtmlCodeField\HtmlCode;

public function fields(NovaRequest $request): array
{
    return [
        HtmlCode::make('HTML Content', 'content')
            // Include stylesheets into iframe for more accurate preview
            ->styles([
                'https://cdn.example.com/custom.css', // from a CDN
                Vite::asset('resources/css/app.css'), // from your app
            ])
            // Wrap the HTML content in a template ("%CODE%" is required)
            ->previewTemplate('<section class="panel">%CODE%</section>'),
    ];
}

Contributing

Please see CONTRIBUTING for details on how to contribute to this project.

Testing

composer test

Code Style

# Fix code style
composer cs:fix

Security

If you discover any security-related issues, please email the maintainers instead of using the issue tracker.

Credits

License

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

统计信息

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

GitHub 信息

  • Stars: 11
  • Watchers: 6
  • Forks: 0
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固