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

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

wimil/comments
==============

Comments for Laravel.

05PHP

Since Sep 26Pushed 6y ago1 watchersCompare

[ Source](https://github.com/wimil/comments)[ Packagist](https://packagist.org/packages/wimil/comments)[ RSS](/packages/wimil-comments/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Comments for Laravel.
=====================

[](#comments-for-laravel)

Features
--------

[](#features)

- Comments and reply Comments
- Blacklist
- Moderation Mode
    - Mode =&gt; 1 (Public): All comments will be public.
    - Mode =&gt; 2 (Review comments on the blacklist): Comments that do not contain blacklisted words will be public. Otherwise, they will remain hidden
    - Mode =&gt; 3 (Close): Comments will be created that do not contain blacklisted words. Otherwise, they will not be created
- Limit comment characters
- Limit number of links in a comment
- UrlLinker (convert text links to html)

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

[](#installation)

From the command line:

```
composer require wimil/comments
```

### Publish Config &amp; configure

[](#publish-config--configure)

Publish the config file:

```
php artisan vendor:publish --provider="Wimil\Comments\Provider" --tag=config
```

### Publish Migrations

[](#publish-migrations)

You can publish migration to allow you to have more control over your table

```
php artisan vendor:publish --provider="Wimil\Comments\Provider" --tag=migrations
```

### Run migrations

[](#run-migrations)

We need to create the table for comments.

```
php artisan migrate
```

### Add Commenter trait to your Model

[](#add-commenter-trait-to-your-model)

Add the `Commenter` trait to your User model so that you can retrieve the comments for a user:

```
use Wimil\Comments\Commenter;

class User extends Authenticatable
{
    use Notifiable, Commenter;
}
```

### Add Commentable trait to models

[](#add-commentable-trait-to-models)

Add the `Commentable` trait to the model for which you want to enable comments for:

```
use Wimil\Comments\Commentable;

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

If you want to have your own Comment Model create a new one and extend my Comment model.

```
use Wimil\Comments\Model\Comment as BaseComment;

class Comment extends BaseComment
{
    // ...
}
```

and dont forget to update the model name in the `config/comment.php` file.

Comment package comes with several modes.

Usage
-----

[](#usage)

```
$user = App\User::first();
$product = App\Product::first();

// $user->comment(Commentable $model, $comment = '');
$user->comment($product, 'Lorem ipsum ..');
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/406484ac42b37d258e184b26c32a2ff39e80a4716e81f33203732a05219ffb77?d=identicon)[wimil](/maintainers/wimil)

---

Top Contributors

[![wimil](https://avatars.githubusercontent.com/u/54213518?v=4)](https://github.com/wimil "wimil (34 commits)")

---

Tags

backlistcommentslaravelmoderationpackagephpsystem

### Embed Badge

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

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

PHPackages © 2026

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