PHPackages                             opscale-co/nova-dbml-field - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. opscale-co/nova-dbml-field

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

opscale-co/nova-dbml-field
==========================

A Laravel Nova field for editing and visualizing DBML schemas.

1.0.1(3w ago)0161MITShellPHP ^8.3CI passing

Since Apr 24Pushed 3w agoCompare

[ Source](https://github.com/opscale-co/nova-dbml-field)[ Packagist](https://packagist.org/packages/opscale-co/nova-dbml-field)[ RSS](/packages/opscale-co-nova-dbml-field/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (12)Versions (3)Used By (1)

Support us
----------

[](#support-us)

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](https://www.trustpilot.com/review/opscale.co) or sharing your thoughts on social media. Your feedback helps us improve and grow!

📧 **Send us feedback** on what we can improve at . 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  to discuss your project needs.

Thanks for helping Opscale continue to scale! 🚀

Description
-----------

[](#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](https://raw.githubusercontent.com/opscale-co/nova-dbml-field/refs/heads/main/screenshots/nova-dbml-field.png)](https://raw.githubusercontent.com/opscale-co/nova-dbml-field/refs/heads/main/screenshots/nova-dbml-field.png)

Installation
------------

[](#installation)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f276fb93870dc86593dc1ba355a4f644e5c247be9903aa98db5f798f8b9d46fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f707363616c652d636f2f6e6f76612d64626d6c2d6669656c642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/opscale-co/nova-dbml-field)

You can install the package in to a Laravel app that uses [Nova](https://nova.laravel.com) 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
-----

[](#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

[](#field-behavior)

ViewBehaviorCreate / UpdateFile upload dropzone (`.dbml`, `.txt`). Pre-submit parse validation with `@dbml/core`. Invalid DBML blocks the submit.Detail / LensInteractive `VueFlow` diagram with pan, zoom, drag, minimap, grid background, auto-layout via `dagre`.IndexHidden — 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

[](#under-the-hood)

LayerDependencyParser[`@dbml/core`](https://www.npmjs.com/package/@dbml/core) — the official DBML parser.Renderer[`@vue-flow/core`](https://www.npmjs.com/package/@vue-flow/core), `@vue-flow/controls`, `@vue-flow/minimap`, `@vue-flow/background`.Auto-layout[`dagre`](https://www.npmjs.com/package/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
-------

[](#testing)

```
npm run test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/opscale-co/.github/blob/main/CONTRIBUTING.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Opscale](https://github.com/opscale-co)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance95

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~24 days

Total

2

Last Release

22d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3722594?v=4)[opscale](/maintainers/opscale)[@opscale](https://github.com/opscale)

---

Top Contributors

[![opscale-development](https://avatars.githubusercontent.com/u/181295122?v=4)](https://github.com/opscale-development "opscale-development (7 commits)")[![semantic-release-bot](https://avatars.githubusercontent.com/u/32174276?v=4)](https://github.com/semantic-release-bot "semantic-release-bot (2 commits)")

---

Tags

laravelfieldnovaDBML

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/opscale-co-nova-dbml-field/health.svg)

```
[![Health](https://phpackages.com/badges/opscale-co-nova-dbml-field/health.svg)](https://phpackages.com/packages/opscale-co-nova-dbml-field)
```

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)[alexwenzel/nova-dependency-container

A Laravel Nova 4 form container for grouping fields that depend on other field values.

461.1M2](/packages/alexwenzel-nova-dependency-container)[simplesquid/nova-enum-field

A Laravel Nova field to add enums to resources.

52410.1k2](/packages/simplesquid-nova-enum-field)[sietse85/nova-button

(Nova 4+) A Laravel Nova package for adding buttons to your resources.

37362.4k](/packages/sietse85-nova-button)[optimistdigital/nova-notes-field

This Laravel Nova package adds a notes field to Nova's arsenal of fields.

52142.9k](/packages/optimistdigital-nova-notes-field)[outl1ne/nova-color-field

A Laravel Nova Color Picker field.

26259.6k](/packages/outl1ne-nova-color-field)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
