PHPackages                             matthewbdaly/laravel-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. matthewbdaly/laravel-comments

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

matthewbdaly/laravel-comments
=============================

Simple Laravel comment system

1.1.8(7y ago)8563MITPHP

Since Dec 29Pushed 7y ago3 watchersCompare

[ Source](https://github.com/matthewbdaly/laravel-comments)[ Packagist](https://packagist.org/packages/matthewbdaly/laravel-comments)[ RSS](/packages/matthewbdaly-laravel-comments/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (11)Versions (12)Used By (0)

laravel-comments
================

[](#laravel-comments)

[![Build Status](https://camo.githubusercontent.com/d5df3b7fde492936755659233a23c86870802af350068b3932d816000142ba44/68747470733a2f2f7472617669732d63692e6f72672f6d6174746865776264616c792f6c61726176656c2d636f6d6d656e74732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/matthewbdaly/laravel-comments)[![Coverage Status](https://camo.githubusercontent.com/481402722efde4f2490924f2ebce99e2d9020a58bde54e9e7377cad43ed8a89f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d6174746865776264616c792f6c61726176656c2d636f6d6d656e74732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/matthewbdaly/laravel-comments?branch=master)

Simple comments system, loosely inspired by Django's comments system. Allows comments to be attached to an object, and allows for them to be flagged by users for moderator attention.

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

[](#installation)

```
composer require matthewbdaly/laravel-comments

```

You will also need to run `php artisan migrate` to set up the required database tables.

Usage
-----

[](#usage)

To allow comments to be attached to an object, add the trait `Matthewbdaly\LaravelComments\Eloquent\Traits\Commentable` to it. The object will then have a `comments` polymorphic relation.

Views
-----

[](#views)

The package includes a view for submitting comments, named `comments::comments`, which can be included in another view as follows:

```
@include('comments::comments', ['parent' => $post])
```

The value of `parent` must be an instance of the commentable object (eg, a blog post). The view also includes a form for flagging comments.

Obviously, if you prefer you can override this view with your own content.

The package also includes the following views:

- `comments::commentsubmitted`
- `comments::flagsubmitted`

These simply acknowledge receipt of the comment or flag, but are fairly basic and so you should feel free to replace them as you see fit.

Of course there's nothing stopping you creating your own routes and controllers for creating, viewing and flagging comments, and if you wish to build a REST API that allows for adding comments to objects you can just use these models directly:

- `Matthewbdaly\LaravelComments\Eloquent\Models\Comment`
- `Matthewbdaly\LaravelComments\Eloquent\Models\Comment\Flag`

I recommend that you use my repositories, which are as follows:

- `Matthewbdaly\LaravelComments\Contracts\Repositories\Comment`
- `Matthewbdaly\LaravelComments\Contracts\Repositories\Comment\Flag`

These use `matthewbdaly/laravel-repositories` and so implement caching on the decorated repository, making it simple to ensure your models get cached appropriately.

Events
------

[](#events)

You can set up listeners for the following events:

- `Matthewbdaly\LaravelComments\Events\CommentBeingReceived`

Fired before the comment is saved. The package does not validate comments out of the box, but you can use this to validate the comment using whatever method you wish (eg check it with Akismet, check for links), or process it before saving (eg run it through a Markdown parser).

- `Matthewbdaly\LaravelComments\Events\CommentReceived`

Fired when a new comment is submitted. This is useful for creating some sort of notification, such as an SMS, email, push notification etc.

- `Matthewbdaly\LaravelComments\Events\CommentBeingFlagged`

Fired before a comment flag is saved. Useful for processing the flag to amend it before saving it.

- `Matthewbdaly\LaravelComments\Events\CommentFlagged`

This event fires after a comment has been flagged for moderator attention. You can use this event to send whatever notification is most appropriate (eg, email, Slack, SMS).

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~30 days

Recently: every ~2 days

Total

11

Last Release

2802d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a596e5052494181ddc20aedefbebef191cc81008e320df098608c54a1dea7350?d=identicon)[matthewbdaly](/maintainers/matthewbdaly)

---

Top Contributors

[![matthewbdaly](https://avatars.githubusercontent.com/u/450801?v=4)](https://github.com/matthewbdaly "matthewbdaly (72 commits)")

---

Tags

commentslaravellaravel-5-packagephplaravelcomments

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/matthewbdaly-laravel-comments/health.svg)

```
[![Health](https://phpackages.com/badges/matthewbdaly-laravel-comments/health.svg)](https://phpackages.com/packages/matthewbdaly-laravel-comments)
```

###  Alternatives

[lakm/laravel-comments

Integrate seamless commenting functionality into your Laravel project.

40614.3k1](/packages/lakm-laravel-comments)[tizis/lara-comments

Comments system for your Laravel application. Features: can be used to comment on any model, HTML filter customization (HTMLPurifier), API, comment rating, replies, events, auth rules ...

1194.7k](/packages/tizis-lara-comments)[fbf/laravel-comments

A Laravel 4 package for adding commenting to a website that has user accounts

214.6k](/packages/fbf-laravel-comments)[klisl/laravel-comments

Package for using comments in Laravel-5

153.4k](/packages/klisl-laravel-comments)

PHPackages © 2026

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