PHPackages                             mll-lab/laravel-comment - 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. mll-lab/laravel-comment

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

mll-lab/laravel-comment
=======================

Just another comment system for your awesome Laravel project.

1.5.0(1y ago)680.3k↑24.6%3MITPHPPHP ^7.1 || ^8CI passing

Since Jun 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mll-lab/laravel-comment)[ Packagist](https://packagist.org/packages/mll-lab/laravel-comment)[ Docs](https://github.com/mll-lab/laravel-comment)[ RSS](/packages/mll-lab-laravel-comment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (23)Used By (0)

Laravel Comment
===============

[](#laravel-comment)

[![Validate](https://github.com/mll-lab/laravel-comment/workflows/Validate/badge.svg)](https://github.com/mll-lab/laravel-comment/actions)[![Code Coverage](https://camo.githubusercontent.com/dd715233d5ef83c426483baee658be53e73d6c1984662d15dbf290821e1b1e77/68747470733a2f2f636f6465636f762e696f2f67682f6d6c6c2d6c61622f6c61726176656c2d636f6d6d656e742f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/mll-lab/laravel-comment)

[![Packagist](https://camo.githubusercontent.com/7fe7d49d37e1b44beb526d140ebcc8b7e9a548e11ffaf7bcc11fea4fe3f0db19/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6c6c2d6c61622f6c61726176656c2d636f6d6d656e742e737667)](https://packagist.org/packages/mll-lab/laravel-comment)[![Latest Stable Version](https://camo.githubusercontent.com/ed7b870b904919739c0b17259ded6b8b07d33b1611c39098b0450965fca10b25/68747470733a2f2f706f7365722e707567782e6f72672f6d6c6c2d6c61622f6c61726176656c2d636f6d6d656e742f762f737461626c65)](https://packagist.org/packages/mll-lab/laravel-comment)

Just another comment system for your awesome Laravel project.

Install
-------

[](#install)

Via Composer:

```
composer require mll-lab/laravel-comment

```

Publish configurations and migrations, then migrate the `comments` table:

```
php artisan vendor:publish
php artisan migrate

```

Add the `CanComment` trait to your User model:

```
use Actuallymab\LaravelComment\CanComment;

final class User extends Model
{
    use CanComment;
```

Add the `Commentable` interface and the `HasComments` trait to your commentable model(s):

```
use Actuallymab\LaravelComment\Contracts\Commentable;
use Actuallymab\LaravelComment\HasComments;

final class Product extends Model implements Commentable
{
    use HasComments;
```

If you want to have your own `Comment` Model create a new one and extend `Actuallymab\LaravelComment\Models\Comment`:

```
use Actuallymab\LaravelComment\Models\Comment as LaravelComment;

final class Comment extends LaravelComment
```

> Don't forget to update the model class in `config/comment.php`.

### Allow rating

[](#allow-rating)

```
final class Product extends Model implements Commentable
{
    use HasComments;

    public function canBeRated(): bool
    {
        return true; // default false
    }
```

### Require comments to be approved

[](#require-comments-to-be-approved)

```
final class Product extends Model implements Commentable
{
    use HasComments;

    public function mustBeApproved(): bool
    {
        return true; // default false
    }
```

### Allow some users to comment without approval

[](#allow-some-users-to-comment-without-approval)

```
final class User extends Model
{
    use CanComment;

    protected $fillable = [
        'isAdmin',
    ];

    public function canCommentWithoutApprove(): bool
    {
        return $this->isAdmin;
    }
```

Usage
-----

[](#usage)

```
$user = User::firstOrFail();
$product = Product::firstOrFail();

// Pass the model to comment, the content and an optional rate
$user->comment($product, 'Lorem ipsum ..', 3);

// Only necessary if:
// - User::canCommentWithoutApprove() returns false
// - Product::mustBeApproved() returns true
$product->comments[0]->approve();

// Calculates the average rating of approved comments
$product->averageRate();

// Calculates the amount of approved comments
$product->totalCommentsCount();
```

> Tip: You might want to look at the tests/CommentTest.php file to check all potential usages.

Changelog
---------

[](#changelog)

All notable changes to this project are documented in [`CHANGELOG.md`](CHANGELOG.md).

Contributing
------------

[](#contributing)

See [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md).

Security
--------

[](#security)

If you discover any security related issues, email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Mehmet Aydın Bahadır](https://github.com/actuallymab)
- [All Contributors](../../contributors)

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance45

Moderate activity, may be stable

Popularity37

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 63.7% 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 ~152 days

Recently: every ~327 days

Total

22

Last Release

433d ago

Major Versions

v0.6.1 → 1.0.02018-11-21

PHP version history (9 changes)0.1.0PHP ~5.5|~7.0

0.2.0PHP &gt;=5.6.4

0.4.0PHP &gt;=7.0.0

0.5.0PHP &gt;=7.1.3

v0.6.0PHP &gt;=7.2.3

v0.6.1PHP ^7.1.3

1.1.0PHP ^7.1|^8.0

1.2.0PHP ^7.1 || ^8.0

1.3.0PHP ^7.1 || ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ff5d1af2c0f601f7ed7e75e15be0aa4c062149b57fd5aace4e44cc37b8b7a40?d=identicon)[spawnia](/maintainers/spawnia)

---

Top Contributors

[![ShortlyMAB](https://avatars.githubusercontent.com/u/4995979?v=4)](https://github.com/ShortlyMAB "ShortlyMAB (58 commits)")[![spawnia](https://avatars.githubusercontent.com/u/12158000?v=4)](https://github.com/spawnia "spawnia (24 commits)")[![coding-sunshine](https://avatars.githubusercontent.com/u/3206025?v=4)](https://github.com/coding-sunshine "coding-sunshine (2 commits)")[![aalaap](https://avatars.githubusercontent.com/u/79404?v=4)](https://github.com/aalaap "aalaap (2 commits)")[![softwarecuisine](https://avatars.githubusercontent.com/u/62079128?v=4)](https://github.com/softwarecuisine "softwarecuisine (1 commits)")[![stephenjude](https://avatars.githubusercontent.com/u/31182887?v=4)](https://github.com/stephenjude "stephenjude (1 commits)")[![JaZo](https://avatars.githubusercontent.com/u/3475007?v=4)](https://github.com/JaZo "JaZo (1 commits)")[![mohammad6006](https://avatars.githubusercontent.com/u/553379?v=4)](https://github.com/mohammad6006 "mohammad6006 (1 commits)")[![mohammad-y](https://avatars.githubusercontent.com/u/30681568?v=4)](https://github.com/mohammad-y "mohammad-y (1 commits)")

---

Tags

laravel-comment

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mll-lab-laravel-comment/health.svg)

```
[![Health](https://phpackages.com/badges/mll-lab-laravel-comment/health.svg)](https://phpackages.com/packages/mll-lab-laravel-comment)
```

###  Alternatives

[illuminate/pipeline

The Illuminate Pipeline package.

9346.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[illuminate/broadcasting

The Illuminate Broadcasting package.

7126.5M178](/packages/illuminate-broadcasting)[illuminate/redis

The Illuminate Redis package.

8314.0M314](/packages/illuminate-redis)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)

PHPackages © 2026

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