Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore.

15 St Margarets, NY 10033
(+381) 11 123 4567



Simple Comments Package for Laravel

The Laravel Comments package by Ryan Chandler is a dead-simple package for adding comments to models in Laravel. Using the HasComments trait on your models, you can quickly add comments attributed to users:

1use RyanChandlerCommentsConcernsHasComments;


3class Post extends Model


5 use HasComments;


Given a post model, you can add a comment using the following method:

1$post = Post::first();


3$post->comment('Hello, world!');

The above example is automatically attributed to the logged-in user. You can also assign a comment to a specific user:

1$post->comment('Hello, world!', user: $user);

This package also supports comment parent threads, meaning a comment can belong to another comment.

You can learn about this package, get full installation instructions, and view the source code on GitHub.

Credit: Source link

Previous Next
Test Caption
Test Description goes like this