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

Abandoned → [mll-lab/laravel-comment](/?search=mll-lab%2Flaravel-comment)ArchivedLibrary

actuallymab/laravel-comment
===========================

Just another comment system for your awesome Laravel project.

1.0.7(5y ago)228172.4k↓38.9%63[8 issues](https://github.com/actuallymab/laravel-comment/issues)[2 PRs](https://github.com/actuallymab/laravel-comment/pulls)1MITPHPPHP ^7.1.3

Since Jun 12Pushed 4y ago11 watchersCompare

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

READMEChangelog (10)Dependencies (5)Versions (19)Used By (1)

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

[](#laravel-comment)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8123415431f49f2ae15ca729bb85fb0c1c74a9825ffb994b3f48ecfe6e265c0e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61637475616c6c796d61622f6c61726176656c2d636f6d6d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/actuallymab/laravel-comment)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/6e74c1e894566dae9c5e5e371254b02d1505b276cb3bab2700996a41de3ce49f/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f61637475616c6c796d61622f6c61726176656c2d636f6d6d656e742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/actuallymab/laravel-comment)[![Total Downloads](https://camo.githubusercontent.com/eb6ea9c499ce8610a689ae70c99522129674b420a8f6bd09b28e0cb324e08175/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61637475616c6c796d61622f6c61726176656c2d636f6d6d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/actuallymab/laravel-comment)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/62393f5d856d1f903c9bebb7577d8d06d621b51f7af021e07a42136f59724b9e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61637475616c6c796d61622f6c61726176656c2d636f6d6d656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/actuallymab/laravel-comment/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/bc1021e010e3d1d2bb1ade917a8a0fd99649538deaa32213a63486135fa8ff2b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61637475616c6c796d61622f6c61726176656c2d636f6d6d656e742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/actuallymab/laravel-comment/?branch=master)

Just another comment system for your awesome Laravel project.

Version Compatibility
---------------------

[](#version-compatibility)

LaravelLaravel Comment5.0.x0.1.x5.1.x0.1.x5.2.x0.1.x5.3.x0.2.x5.4.x0.3.xFor `>5.5` you can use `^1.0.0` version.

Install
-------

[](#install)

Via Composer

```
$ composer require actuallymab/laravel-comment
```

If you don't use auto-discovery, or using Laravel version &lt; 5.5 Add service provider to your app.php file

```
\Actuallymab\LaravelComment\LaravelCommentServiceProvider::class
```

Publish configurations and migrations, then migrate comments table.

```
$ php artisan vendor:publish
$ php artisan migrate
```

Add `CanComment` trait to your User model.

```
use Actuallymab\LaravelComment\CanComment;

class User extends Model
{
    use CanComment;

    // ...
}
```

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

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

class Product extends Model implements Commentable
{
    use HasComments;

    // ...
}
```

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

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

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

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

Comment package comes with several modes.

1- If you want to users can rate your commentable models;

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

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

    //...
}
```

2- If you want to approve comments for your commentable models;

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

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

    // ...
}
```

3- Sometimes you don't want to approve comments for all users;

```
class User extends Model
{
    use CanComment;

    protected $fillable = [
        'isAdmin',
        // ..
    ];

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

    // ..
}
```

Usage
-----

[](#usage)

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

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

// approve it -- if the user model `canCommentWithoutApprove()` or you don't use `mustBeApproved()`, it is not necessary
$product->comments[0]->approve();

// get avg rating -- it calculates approved average rate.
$product->averageRate();

// get total comments count -- it calculates approved comments count.
$product->totalCommentsCount();
```

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

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

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

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 89.2% 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 ~98 days

Recently: every ~143 days

Total

17

Last Release

2060d ago

Major Versions

v0.6.1 → 1.0.02018-11-21

PHP version history (6 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

### Community

Maintainers

![](https://www.gravatar.com/avatar/66f5dd4ad88e10b8c9bd2655cb7e34aec186c9de2f25c4a23bcec9db7e0a82ba?d=identicon)[ActuallyMAB](/maintainers/ActuallyMAB)

---

Top Contributors

[![ShortlyMAB](https://avatars.githubusercontent.com/u/4995979?v=4)](https://github.com/ShortlyMAB "ShortlyMAB (58 commits)")[![aalaap](https://avatars.githubusercontent.com/u/79404?v=4)](https://github.com/aalaap "aalaap (2 commits)")[![coding-sunshine](https://avatars.githubusercontent.com/u/3206025?v=4)](https://github.com/coding-sunshine "coding-sunshine (2 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)")[![softwarecuisine](https://avatars.githubusercontent.com/u/62079128?v=4)](https://github.com/softwarecuisine "softwarecuisine (1 commits)")

---

Tags

commentlaravellaravel-commentlaravel-commentablelaravel-packagelaravel-commentactuallymab

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[iyzico/iyzipay-laravel

Iyzipay (by Iyzico) integration for your Laravel projects.

8612.1k](/packages/iyzico-iyzipay-laravel)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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