Download the PHP package opscale-co/nova-comments without Composer
On this page you can find all versions of the php package opscale-co/nova-comments. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download opscale-co/nova-comments
More information about opscale-co/nova-comments
Files in opscale-co/nova-comments
Package nova-comments
Short Description Polymorphic comments field for any Laravel Nova Resource — Opscale fork of kirschbaum-development/nova-comments.
License MIT
Homepage https://github.com/opscale-co/nova-comments
Informations about the package nova-comments
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 or sharing your thoughts on social media.
📧 Send us feedback on what we can improve at [email protected].
🙏 Get involved by actively contributing to our open-source repositories.
💼 Hire us at [email protected] for custom dashboards, admin panels, internal tools, or MVPs.
Thanks for helping Opscale continue to scale! 🚀
opscale-co/nova-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 — 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
The service provider auto-registers via package discovery. Publish the config if you need to customize it:
Usage
1. Add the Commentable trait to a model
2. Add the Commenter field to the model's Nova Resource
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
Prefer Nova's standard relationship table over the inline panel? Use the CommentsPanel:
Custom sanitization
By default, comments are stored as the Trix-produced HTML as-is. Trix sanitizes input client-side (no <script>, 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:
Pass null to clear the callback.
Configuration
config/nova-comments.php:
| Key | Default | Purpose |
|---|---|---|
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 page |
Testing
Browser (Dusk) tests run against a workbench Nova app:
Changelog
See CHANGELOG.
Contributing
Please see CONTRIBUTING.
Credits
- Opscale
- Inspired by
kirschbaum-development/nova-comments— © Kirschbaum Development Group LLC
License
The MIT License (MIT). Please see License File.
All versions of nova-comments with dependencies
laravel/nova Version ^5.4
opscale-co/nova-package-tools Version ^1.1
symfony/html-sanitizer Version ^7.4