PHPackages                             opscale-co/nova-comments - 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-comments

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

opscale-co/nova-comments
========================

Polymorphic comments field for any Laravel Nova Resource — Opscale fork of kirschbaum-development/nova-comments.

1.1.0(3w ago)0331MITShellPHP &gt;=8.2CI passing

Since Jun 14Pushed 3w agoCompare

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

READMEChangelog (2)Dependencies (12)Versions (5)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.

📧 **Send us feedback** on what we can improve at .

🙏 **Get involved** by actively contributing to our open-source repositories.

💼 **Hire us** at  for custom dashboards, admin panels, internal tools, or MVPs.

Thanks for helping Opscale continue to scale! 🚀

---

opscale-co/nova-comments
------------------------

[](#opscale-conova-comments)

A Laravel Nova 5 field that adds polymorphic comments to any Nova Resource. This is the Opscale-maintained fork of [`kirschbaum-development/nova-comments`](https://github.com/kirschbaum-development/nova-comments) — same surface area (Commenter ResourceTool, Commentable trait, CommentsPanel, `nova_comments` table, `whenCreating` sanitization hook) under Opscale conventions (`declare(strict_types=1)`, PHPStan level 8, Duster, Semantic Release, single-tenant deployment model).

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

[](#installation)

[![Latest Version on Packagist](https://camo.githubusercontent.com/507dcc419ac2ec5ec27f8f413706186a5050f5639b5f8406fc27ea2ab710433a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f707363616c652d636f2f6e6f76612d636f6d6d656e74732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/opscale-co/nova-comments)

```
composer require opscale-co/nova-comments
php artisan migrate
```

The service provider auto-registers via package discovery. Publish the config if you need to customize it:

```
php artisan vendor:publish --tag=nova-comments-config
```

Usage
-----

[](#usage)

### 1. Add the `Commentable` trait to a model

[](#1-add-the-commentable-trait-to-a-model)

```
use Opscale\NovaComments\Commentable;

class Post extends Model
{
    use Commentable;
}
```

### 2. Add the `Commenter` field to the model's Nova Resource

[](#2-add-the-commenter-field-to-the-models-nova-resource)

```
use Opscale\NovaComments\Commenter;

public function fields(NovaRequest $request): array
{
    return [
        // ... your other fields ...
        Commenter::make(),
    ];
}
```

That's it. The comments panel renders on the resource detail page with a Trix rich-text editor (bold, italic, lists, links, etc.). Authenticated Nova users can write comments, paginate older / newer, and submit with the Save button or ⌘+Enter.

### Alternative: the relationship panel

[](#alternative-the-relationship-panel)

Prefer Nova's standard relationship table over the inline panel? Use the `CommentsPanel`:

```
use Opscale\NovaComments\CommentsPanel;

public function fields(NovaRequest $request): array
{
    return [
        // ... fields ...
        new CommentsPanel(),
    ];
}
```

### Custom sanitization

[](#custom-sanitization)

By default, comments are stored as the Trix-produced HTML as-is. Trix sanitizes input client-side (no ``, no inline event handlers), which covers the common case. If you need server-side sanitization — Markdown rendering, an HTML purifier, or just to be paranoid about direct API calls — register a callback in a service provider:

```
use Opscale\NovaComments\Models\Comment;

public function boot(): void
{
    Comment::whenCreating(function (Comment $comment): void {
        $comment->comment = MyPurifier::clean($comment->comment);
    });
}
```

Pass `null` to clear the callback.

Configuration
-------------

[](#configuration)

`config/nova-comments.php`:

KeyDefaultPurpose`commenter.nova-resource``\App\Nova\User::class`Nova resource used for the `commenter` BelongsTo field`comments-panel.name``null` (uses translation)Heading shown above the panel`limit``100`Max length of the comment preview on the index pageTesting
-------

[](#testing)

```
composer install
vendor/bin/phpunit --exclude-testsuite=Browser
```

Browser (Dusk) tests run against a workbench Nova app:

```
npm ci && npm run prod      # build dist/ assets
vendor/bin/phpunit --testsuite=Browser
```

Changelog
---------

[](#changelog)

See [CHANGELOG](CHANGELOG.md).

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Opscale](https://github.com/opscale-co)
- Inspired by [`kirschbaum-development/nova-comments`](https://github.com/kirschbaum-development/nova-comments) — © Kirschbaum Development Group LLC

License
-------

[](#license)

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

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance95

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.6% 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 ~11 days

Total

3

Last Release

23d 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 (11 commits)")[![semantic-release-bot](https://avatars.githubusercontent.com/u/32174276?v=4)](https://github.com/semantic-release-bot "semantic-release-bot (3 commits)")

---

Tags

laravelcommentsnovapolymorphicopscale

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

### Embed Badge

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

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

###  Alternatives

[optimistdigital/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2852.1M6](/packages/optimistdigital-nova-sortable)[outl1ne/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2862.1M9](/packages/outl1ne-nova-sortable)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[advoor/nova-editor-js

A Laravel Nova field bringing EditorJs magic to Nova.

92219.3k3](/packages/advoor-nova-editor-js)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57249.9k](/packages/sbine-route-viewer)[mostafaznv/nova-map-field

Map Field for Laravel Nova

46107.9k](/packages/mostafaznv-nova-map-field)

PHPackages © 2026

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