PHPackages                             orkhanahmadov/laravel-commentable - 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. [Database &amp; ORM](/categories/database)
4. /
5. orkhanahmadov/laravel-commentable

ActiveLibrary[Database &amp; ORM](/categories/database)

orkhanahmadov/laravel-commentable
=================================

Laravel commentable model

1.1.0(4y ago)135252MITPHPPHP ^7.2|^8.0CI failing

Since Nov 5Pushed 4y ago2 watchersCompare

[ Source](https://github.com/orkhanahmadov/laravel-commentable)[ Packagist](https://packagist.org/packages/orkhanahmadov/laravel-commentable)[ Docs](https://github.com/orkhanahmadov/laravel-commentable)[ GitHub Sponsors](https://github.com/orkhanahmadov)[ RSS](/packages/orkhanahmadov-laravel-commentable/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

Laravel commentable model
=========================

[](#laravel-commentable-model)

[![Latest Stable Version](https://camo.githubusercontent.com/b3a0f72f431aece328f69e9e297cec960b10d9cb8b052dd2cc7500d326f177c6/68747470733a2f2f706f7365722e707567782e6f72672f6f726b68616e61686d61646f762f6c61726176656c2d636f6d6d656e7461626c652f762f737461626c65)](https://packagist.org/packages/orkhanahmadov/laravel-commentable)[![Latest Unstable Version](https://camo.githubusercontent.com/a4ed5fecd8445de7be2f158329f00fb14bd346f778c13f73f8d9e6695b39298a/68747470733a2f2f706f7365722e707567782e6f72672f6f726b68616e61686d61646f762f6c61726176656c2d636f6d6d656e7461626c652f762f756e737461626c65)](https://packagist.org/packages/orkhanahmadov/laravel-commentable)[![Total Downloads](https://camo.githubusercontent.com/0fc71904b19222069298b99fe837a381d7e836c7e7c43b85dcbd5f19a4b954f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f726b68616e61686d61646f762f6c61726176656c2d636f6d6d656e7461626c65)](https://packagist.org/packages/orkhanahmadov/laravel-commentable)[![License](https://camo.githubusercontent.com/e315dc635574027795fcd2febdbc1e9bbc33e93a8873800115955962b95c0836/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f726b68616e61686d61646f762f6c61726176656c2d636f6d6d656e7461626c652e737667)](https://github.com/orkhanahmadov/laravel-commentable/blob/master/LICENSE.md)

[![Build Status](https://camo.githubusercontent.com/4eb480b732e4298fae65d76140b51d235261c920dce68c36daf24fb8b6e13473/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6f726b68616e61686d61646f762f6c61726176656c2d636f6d6d656e7461626c652e737667)](https://travis-ci.org/orkhanahmadov/laravel-commentable)[![Test Coverage](https://camo.githubusercontent.com/d96b85f6112e1939e32b27b56b78c23d48ba8022aa61391eec3049d9335b699d/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f61343837326263666534383464376366363133662f746573745f636f766572616765)](https://codeclimate.com/github/orkhanahmadov/laravel-commentable/test_coverage)[![Maintainability](https://camo.githubusercontent.com/3a841385ca5178e43cc160e5850ee6b4fc44bc7ad39cd2f2376595a8f0d883bd/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f61343837326263666534383464376366363133662f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/orkhanahmadov/laravel-commentable/maintainability)[![Quality Score](https://camo.githubusercontent.com/03437d793ff7722de730c46d34bbce7e3c11b70151f93038bb86b48b10d3715c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6f726b68616e61686d61646f762f6c61726176656c2d636f6d6d656e7461626c652e737667)](https://scrutinizer-ci.com/g/orkhanahmadov/laravel-commentable)[![StyleCI](https://camo.githubusercontent.com/26692bda7bde4d9dc5ca7a5af5ba1b77f3f2ae86f08d689ac23f9bf2daceb837/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3231393731373436382f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/219717468)

This package provides adding comments to any of your existing Eloquent models.

Requirements
------------

[](#requirements)

- PHP 7.2 or higher
- Laravel 6 or higher

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

[](#installation)

You can install the package via composer:

```
composer require orkhanahmadov/laravel-commentable
```

Publish migration and config files:

```
php artisan vendor:publish --provider="Orkhanahmadov\LaravelCommentable\LaravelCommentableServiceProvider"
```

Config
------

[](#config)

Config file contains following settings:

- `table_name` - here you are set table name for migration. Default is "comments".

Usage
-----

[](#usage)

Use `Orkhanahmadov\LaravelCommentable\Commentable` trait in any of your existing Eloquent model to make it commentable.

```
use Illuminate\Database\Eloquent\Model;
use Orkhanahmadov\LaravelCommentable\Commentable;

class Post extends Model
{
    use Commentable;
}
```

To add a comment to your model call `comment()` method from model instance.

```
$post = Post::find(1);
$post->comment('Great post, thanks for sharing!');
```

To add a comment as a user call `commentAs()` method from model instance.

```
$post = Post::find(1);
$user = User::find(5);
$post->commentAs($user, 'Great post, thanks for sharing!');
```

Each comment also saves IP address, User-Agent from request.

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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

[](#contributing)

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

### Security

[](#security)

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

Credits
-------

[](#credits)

- [Orkhan Ahmadov](https://github.com/orkhanahmadov)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

Every ~579 days

Total

2

Last Release

1801d ago

PHP version history (2 changes)1.0.0PHP ^7.1

1.1.0PHP ^7.2|^8.0

### Community

Maintainers

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

---

Top Contributors

[![orkhanahmadov](https://avatars.githubusercontent.com/u/7041590?v=4)](https://github.com/orkhanahmadov "orkhanahmadov (24 commits)")

---

Tags

laravelmodeleloquentcommentslaravel-commentableorkhanahmadov

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/orkhanahmadov-laravel-commentable/health.svg)

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

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)[pdphilip/elasticsearch

An Elasticsearch implementation of Laravel's Eloquent ORM

145360.2k4](/packages/pdphilip-elasticsearch)[sebastiaanluca/laravel-boolean-dates

Automatically convert Eloquent model boolean attributes to dates (and back).

40111.7k1](/packages/sebastiaanluca-laravel-boolean-dates)

PHPackages © 2026

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