定制 opscale-co/nova-dbml-field 二次开发

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

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

opscale-co/nova-dbml-field

Composer 安装命令:

composer require opscale-co/nova-dbml-field

包简介

A Laravel Nova field for editing and visualizing DBML schemas.

README 文档

README

At Opscale, we’re passionate about contributing to the open-source community by providing solutions that help businesses scale efficiently. If you’ve found our tools helpful, here are a few ways you can show your support:

Star this repository to help others discover our work and be part of our growing community. Every star makes a difference!

💬 Share your experience by leaving a review on Trustpilot or sharing your thoughts on social media. Your feedback helps us improve and grow!

📧 Send us feedback on what we can improve at feedback@opscale.co. We value your input to make our tools even better for everyone.

🙏 Get involved by actively contributing to our open-source repositories. Your participation benefits the entire community and helps push the boundaries of what’s possible.

💼 Hire us if you need custom dashboards, admin panels, internal tools or MVPs tailored to your business. With our expertise, we can help you systematize operations or enhance your existing product. Contact us at hire@opscale.co to discuss your project needs.

Thanks for helping Opscale continue to scale! 🚀

Description

DBML is a great way to document a database schema, but inspecting one means jumping out to dbdiagram.io or another external tool every time. This package brings the diagram into your admin panel: upload a .dbml file from any Nova resource and the interactive ER diagram shows up right on the record. Compatible with Nova 5.

Demo

Installation

Latest Version on Packagist

You can install the package in to a Laravel app that uses Nova via composer:

composer require opscale-co/nova-dbml-field

The package will auto-register its service provider.

Back your field with a longText (or text) column on the owning model. The field stores the raw DBML as plain text — no disk configuration required.

Schema::create('schemas', function (Blueprint $table) {
    $table->id();
    $table->string('name');
    $table->longText('dbml')->nullable();
    $table->timestamps();
});

Usage

Add the DBML field to any Nova Resource that owns a DBML attribute:

use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Resource;
use Opscale\Fields\DBML;

class Schema extends Resource
{
    public static $model = \App\Models\Schema::class;

    public function fields(NovaRequest $request): array
    {
        return [
            ID::make()->sortable(),
            Text::make('Name')->rules('required', 'max:255'),
            DBML::make('Schema', 'dbml')->rules('required'),
        ];
    }
}

On Create / Update the field renders Nova’s native file dropzone — pick a .dbml file, the contents are parsed client-side with @dbml/core and only submitted if they parse cleanly. On Detail / Lens the field renders the full interactive diagram. It is intentionally hidden from Index.

Field behavior

View Behavior
Create / Update File upload dropzone (.dbml, .txt). Pre-submit parse validation with @dbml/core. Invalid DBML blocks the submit.
Detail / Lens Interactive VueFlow diagram with pan, zoom, drag, minimap, grid background, auto-layout via dagre.
Index Hidden — a full diagram inside a table cell adds no decision-making value.
API (raw string) fillAttributeFromRequest transparently accepts a raw DBML string for programmatic callers.

Under the hood

Layer Dependency
Parser @dbml/core — the official DBML parser.
Renderer @vue-flow/core, @vue-flow/controls, @vue-flow/minimap, @vue-flow/background.
Auto-layout dagre with rankdir: LR.

All three live behind a one-way pipeline (parser → graph adapter → layout → renderer) — no step mutates earlier results, results are memoized per DBML string.

Testing

npm run test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email development@opscale.co instead of using the issue tracker.

Credits

License

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

opscale-co/nova-dbml-field 适用场景与选型建议

opscale-co/nova-dbml-field 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「nova」 「laravel」 「field」 「DBML」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 opscale-co/nova-dbml-field 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 opscale-co/nova-dbml-field 我们能提供哪些服务?
定制开发 / 二次开发

基于 opscale-co/nova-dbml-field 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Shell

其他信息

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