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

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

finagin/laravel-comment
=======================

Comments for Laravel 5.4 and up

0.1.0(9y ago)0352MITPHPPHP &gt;=7.0CI failing

Since Jun 29Pushed 9y ago1 watchersCompare

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

READMEChangelogDependencies (9)Versions (3)Used By (0)

Comments for Laravel 5.4 and up
===============================

[](#comments-for-laravel-54-and-up)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0dd5972b701b3c1277af694084c6e34d6f5a0131130b3dfce1ca0d02fca0d956/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66696e6167696e2f6c61726176656c2d636f6d6d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/finagin/laravel-comment)[![Software License](https://camo.githubusercontent.com/7123c32787e013be5a8a13598ad01f562754637ed6141e89b02e85bf16d3e63e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6173686170652f6170697374617475732e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/3c436402d30485cafde79c57d8fc11ffe512957e6f76757fd5c5c74898344566/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f66696e6167696e2f6c61726176656c2d636f6d6d656e742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/finagin/laravel-comment)[![StyleCI](https://camo.githubusercontent.com/2bba9c5f18a4330723dd6e2d88f21f7dcf3f840045d73045765b4ba3dd8d1310/68747470733a2f2f7374796c6563692e696f2f7265706f732f39343535303236352f736869656c64)](https://styleci.io/repos/94550265)[![Total Downloads](https://camo.githubusercontent.com/6e26382cdf85c49e47b51ab016903ac5bec51aa58c875c8edb865e9cb4682acb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66696e6167696e2f6c61726176656c2d636f6d6d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/finagin/laravel-comment)

[![GitHub stars](https://camo.githubusercontent.com/13ad72cfc60cdc20fbb55fd082fd8818dff58f2a6807e51e4852f5694dc9c8d9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f66696e6167696e2f6c61726176656c2d636f6d6d656e742e7376673f7374796c653d736f6369616c266c6162656c3d53746172)](https://github.com/finagin/laravel-comment)

- [Installation](#installation)
- [Usage](#usage)
- [License](#license)

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

[](#installation)

This package can be used in Laravel 5.4 or higher. You can install the package via composer:

```
composer require finagin/laravel-comment
```

Now add the service provider in config/app.php file:

```
'providers' => [
    /*
     * Package Service Providers...
     */
    // ...
    Finagin\Comment\CommentServiceProvider::class,
    // ...
];
```

You must publish the migration with:

```
php artisan vendor:publish --provider="Finagin\Comment\CommentServiceProvider" --tag="migrations"
```

After the migration has been published you must create the settings-tables by running the migrations:

```
php artisan migrate
```

Also you can publish the config file with:

```
php artisan vendor:publish --provider="Finagin\Comment\CommentServiceProvider" --tag="config"
```

Add `CanComment` trait to your User model.

```
use Finagin\Comment\Traits\CanComment;
```

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

```
use Finagin\Comment\Traits\Commentable;
```

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

```
class Comment extends Finagin\Comment\Models\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 Post 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 Post extends Model {
  use Commentable;

  protected $mustBeApproved = true;

  ...
}
```

Usage
-----

[](#usage)

```
$user = App\User::find(1);
$post = App\Post::find(1);

// CanComment->comment(Commentable|Commnet $commentable, string $commentText): Comment

// Anonimous first level comment
$comment = (new User(['name' => 'Anonymous']))->comment($post, 'Lorem ipsum ..');

// Users sub comment
$user
    ->comment($comment, 'Lorem ipsum ..');

// Anonimous sub comment
(new User(['name' => 'Anonymous']))
    ->comment($comment, 'Lorem ipsum ..');
```

License
-------

[](#license)

The MIT License ([MIT](https://opensource.org/licenses/MIT)). Please see [License File](LICENSE) for more information.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3288d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/da006642845e1657076957773452c02aa49bad1d1be5abd3a3be4993414ad68e?d=identicon)[finagin](/maintainers/finagin)

---

Top Contributors

[![finagin](https://avatars.githubusercontent.com/u/11045296?v=4)](https://github.com/finagin "finagin (5 commits)")

---

Tags

commentcommentscomposerlaravelpackagelaravelcommentsfinagin

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k98.0M1.3k](/packages/spatie-laravel-permission)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.7k](/packages/larastan-larastan)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k89.4M575](/packages/laravel-passport)[laravel/ai

The official AI SDK for Laravel.

1.0k2.1M163](/packages/laravel-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9772.3M122](/packages/roots-acorn)

PHPackages © 2026

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