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

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

iahmad/laravel-comment
======================

Just another comment system for laravel projects.

0.4.0(8y ago)146MITPHPPHP &gt;=7.0.0

Since Jun 12Pushed 8y ago1 watchersCompare

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

READMEChangelogDependencies (7)Versions (8)Used By (0)

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)

Just another comment system for laravel projects.

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.x5.5.x0.4.xInstall
-------

[](#install)

Via Composer

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

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

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 &amp; Migrate comments table.

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

Add `CanComment` trait to your User model.

```
use Actuallymab\LaravelComment\CanComment;
```

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

```
use Actuallymab\LaravelComment\Commentable;
```

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

```
class Comment extends Actuallymab\LaravelComment\Comment
{
  ...
}
```

Comment package comes with several modes.

1- If you want to Users can rate your model(s) with comment set `canBeRated` to true in your `Commentable` model.

```
class Product extends Model {
  use Commentable;

  protected $canBeRated = true;

  ...
}
```

2- If you want to approve comments for your commentable models, you must set `mustBeApproved` to true in your `Commentable` model.

```
class Product extends Model {
  use Commentable;

  protected $mustBeApproved = true;

  ...
}
```

3- You don't want to approve comments for all users (think this as you really want to approve your own comments?). So add your `User` model an `isAdmin` method and return it true if user is admin.

```
class User extends Model {
  use CanComment;

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

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

  ...
}
```

Usage
-----

[](#usage)

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

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

// approve it -- if you are admin or you don't use mustBeApproved option, it is not necessary
$product->comments[0]->approve();

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

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

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

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.6% 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 ~89 days

Recently: every ~111 days

Total

6

Last Release

3176d ago

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

0.2.0PHP &gt;=5.6.4

0.4.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/37b615857348c3a0748f7fd8fd5946556e6bd8f9c5abe841964f70b5ad24fb8a?d=identicon)[onemoreahmad](/maintainers/onemoreahmad)

---

Top Contributors

[![ShortlyMAB](https://avatars.githubusercontent.com/u/4995979?v=4)](https://github.com/ShortlyMAB "ShortlyMAB (25 commits)")[![coding-sunshine](https://avatars.githubusercontent.com/u/3206025?v=4)](https://github.com/coding-sunshine "coding-sunshine (2 commits)")

---

Tags

laravel-commentactuallymab

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[illuminatech/balance

Provides support for Balance accounting system based on debit and credit principle

16137.4k](/packages/illuminatech-balance)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[glhd/special

1929.4k](/packages/glhd-special)

PHPackages © 2026

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