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

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

muba00/laravel-comment
======================

Just another comment system for your awesome Laravel project.

1.0.7(5y ago)119MITPHPPHP ^7.1.3

Since Jun 12Pushed 1y agoCompare

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

READMEChangelogDependencies (5)Versions (19)Used By (0)

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

[](#laravel-comment)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bf38728ff8b676c551a3dbfb9937ee8389caf61bd5024ecad4301e0393d7ff0a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d75626130302f6c61726176656c2d636f6d6d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/muba00/laravel-comment)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/ffd6514a9d9629c7b59a36ad48e4329329f5ebcd895938e40ed95ed82310245f/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d75626130302f6c61726176656c2d636f6d6d656e742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/muba00/laravel-comment)[![Total Downloads](https://camo.githubusercontent.com/8c0a06c9c5eb322a068e01ca823f9850f01a5ed18321998f0e0ab13de291bcb1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d75626130302f6c61726176656c2d636f6d6d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/muba00/laravel-comment)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/57f92a4fc16a1f979a7d771c173d2b24272b4e356d6b02dbc9955deea0600303/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d75626130302f6c61726176656c2d636f6d6d656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/muba00/laravel-comment/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/5ae1ee085cf5c8409c969a64e28473b06a1b4d7e226f6bf0bde6bab996c6191d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d75626130302f6c61726176656c2d636f6d6d656e742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/muba00/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 muba00/laravel-comment
```

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

```
\Muba00\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 Muba00\LaravelComment\CanComment;

class User extends Model
{
    use CanComment;

    // ...
}
```

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

```
use Muba00\LaravelComment\Contracts\Commentable;
use Muba00\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 Muba00\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/muba00)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 86.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 ~98 days

Recently: every ~143 days

Total

17

Last Release

2051d 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/182f07da8bb65ea20e8c2dd9d69d8b6fd7722b9741ae623ca0ab593e4c244c76?d=identicon)[muba00](/maintainers/muba00)

---

Top Contributors

[![ShortlyMAB](https://avatars.githubusercontent.com/u/4995979?v=4)](https://github.com/ShortlyMAB "ShortlyMAB (58 commits)")[![muba00](https://avatars.githubusercontent.com/u/11701997?v=4)](https://github.com/muba00 "muba00 (2 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)")[![mohammad-y](https://avatars.githubusercontent.com/u/30681568?v=4)](https://github.com/mohammad-y "mohammad-y (1 commits)")[![mohammad6006](https://avatars.githubusercontent.com/u/553379?v=4)](https://github.com/mohammad6006 "mohammad6006 (1 commits)")[![softwarecuisine](https://avatars.githubusercontent.com/u/62079128?v=4)](https://github.com/softwarecuisine "softwarecuisine (1 commits)")

---

Tags

laravel-commentactuallymab

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-ide-helper

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

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

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

16137.4k](/packages/illuminatech-balance)[glhd/special

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

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

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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