kirschbaum-development / nova-comments Goto Github PK
View Code? Open in Web Editor NEWA commenting tool for Laravel Nova
License: MIT License
A commenting tool for Laravel Nova
License: MIT License
is there any way to add an attachment within the comment?
There is a console log in the mounted()
method of the main Tool Vue component:
Line 331 in 5c90fe5
when comment is created by general form https://big.local/resources/comments/new
i get this error when calling index https://big.local/resources/comments
db looks like this: https://www.dropbox.com/s/xslhxw2h219994u/Screenshot%202020-07-26%2016.10.59.png?dl=0
error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'nova_comments.' in 'where clause' (SQL: select * from nova_comments
where nova_comments
. = 0 limit 1) {"userId":37,"exception":"[object] (Illuminate\\Database\\QueryException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'nova_comments.' in 'where clause' (SQL: select * from `nova_comments` where `nova_comments`.
= 0 limit 1) at /Users/behrangalavi/PhpstormProjects/big-erp-laravel/doc_root/vendor/laravel/framework/src/Illuminate/Database/Connection.php:671)
It would be great if we could do something like mentioning users (with autofill) when typing @adammparker (like the github comments work).
Being able to use markdown would just add clarity / ability to create better comments
nova-comments/src/Nova/Comment.php
Lines 47 to 49 in 3d18bb9
Markdown::make('comment')
->alwaysShow()
->hideFromIndex(),
ref:
The Markdown
field provides a WYSIWYG Markdown editor for its underlying Eloquent attribute. Typically, this field will correspond to a TEXT
column in your database. The Markdown
field will store the raw Markdown text within the associated database column:
use Laravel\Nova\Fields\Markdown;
Markdown::make('Biography'),
By default, Markdown fields will not display their content when viewing a resource's detail page. Instead, the content will be hidden behind a "Show Content" link that will reveal the field's content when clicked. You may specify that the Markdown field should always display its content by calling the alwaysShow
method on the field itself:
Markdown::make('Biography')->alwaysShow(),
The Markdown field uses the league/commonmark
package to parse Markdown content. By default, it uses a parsing strategy similar to GitHub Flavoured Markdown, which does not allow certain HTML within the Markdown content. However, you can change the parsing strategy using the preset
method. Currently, the following built-in presets are default
, commonmark
, and zero
:
Markdown::make('Biography')->preset('commonmark'),
Using the preset
method, you may register and use custom preset implementations:
use Illuminate\Support\Str;
use Laravel\Nova\Fields\Markdown;
use Laravel\Nova\Fields\Markdown\MarkdownPreset;
Markdown::make('Biography')->preset('github', new class implements MarkdownPreset {
/**
* Convert the given content from markdown to HTML.
*
* @param string $content
* @return string
*/
public function convert(string $content)
{
return Str::of($content)->markdown([
'html_input' => 'strip',
]);
}
}),
Using the Commenter() without the CommentsPanel() will throw a 404 error.
In the nova config you can set the path for nova itself:
`/*
|--------------------------------------------------------------------------
| Nova Path
|--------------------------------------------------------------------------
|
| This is the URI path where Nova will be accessible from. Feel free to
| change this path to anything you like. Note that this URI will not
| affect Nova's internal API routes which aren't exposed to users.
|
*/
'path' => '/',`
But this isn't taken into account for the following line of code, could this please be changed?
`commenterUrl() {
let commenterId = _.find(this.comment.fields, { attribute: 'commenter' }).belongsToId;
return `/nova/resources/users/${commenterId}`;
},`
The Commenter resource tool loads no comments with a 409 and 404s on submitting a new comment.
Loading makes a request to http://127.0.0.1:8000/nova-api/comments?page=1&orderBy=created_at&orderByDirection=desc&viaResource=issues&viaResourceId=4&viaRelationship=comments&relationshipType=hasMany and throws Symfony\Component\HttpKernel\Exception\HttpException at \vendor\laravel\framework\src\Illuminate\Foundation\Application.php:1116
https://flareapp.io/share/J7oj2odP?error=J7oj2odP&owner_token=Z9rRtT9iV2S0HkeKk60A6GngRV1udzCF#F60L1116
Submitting a new comment 404s on http://127.0.0.1:8000/nova-api/comments
I installed as follows:
composer require kirschbaum-development/nova-comments
php artisan migrate
use Commentable; in my model and new Commenter(), in the fields function of the Nova resource.
The CommentsPanel works, but it's not worth having this package just for that, especially as there's no image/attachment functionality.
When using line breaks in a comment they are not being rendered the same way in the comment panel. It is showing up as a giant run on sentence.
Thanks in advance for the help.
is there any way to change frontend label ? i.e. translate it?
i can' find a way.
I get a composer error when trying to install this with Nova (2.0.9):
`โ composer require kirschbaum-development/nova-comments
Using version ^1.0 for kirschbaum-development/nova-comments
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- kirschbaum-development/nova-comments 1.0.1 requires laravel/nova ^2.0 -> no matching package found.
- kirschbaum-development/nova-comments 1.0.0 requires laravel/nova ^2.0 -> no matching package found.
- Installation request for kirschbaum-development/nova-comments ^1.0 -> satisfiable by kirschbaum-development/nova-comments[1.0.0, 1.0.1].`
Since this repository hasn't been updated since March 2020, and current version does not support Laravel Nova v4.x, I've forked the repo and made necessary changes.
Primary change: fixed Comment Resource to match the new Nova 4 signature with NovaRequest instead of Request
Description of the major changes from Nova 4: https://nova.laravel.com/docs/4.0/upgrade.html#nova-request
My fork of nova-comments with support for Nova 4: https://github.com/amukhin-cyberhull/nova-comments
Please make this url dynamic. See config "nova.path"
Hi,
First, thans yo tou guys :)
I need to understand, why are you displaying comment ressource in sidebar navigation ?
If we can fast adding comments in other resources details, why is this useful in nav ?
Im in case where i need to remove comment resource from navigation sideba and i can't overide your comment nova resource. Or im i missing somethink ?
just an idea.
when a comment is posted, notify the user owning model or taking part of the discussion via notifications -> https://nova.laravel.com/docs/4.0/customization/notifications.html
Added comments are not showing. I can see in browser console error ReferenceError: _ is not defined
.
Package version: 4.0.0
Laravel: 9.31
Laravel Nova: 4.15.1
Looks like problem with lodash importing.
Steps for reproducing:
composer require kirschbaum-development/nova-comments
php artisan migrate
use Commentable;
to Model.public function fields(Request $request)
{
return [
// ...
HasMany::make('Comments', 'comments', Comment::class)
->hideFromDetail()
->hideFromIndex(),
Commenter::make(),
//
];
ReferenceError: _ is not defined
I'm trying to change the group of resource comments to move it in the frontend menu
is there any known way?
greets
I suggest to add a feature that shows the latest N comments also in the index view and gives space to a modal to see all comments.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.