PHPackages                             webudvikleren/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. webudvikleren/laravel-commentable

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

webudvikleren/laravel-commentable
=================================

Easily add comments to any Laravel model

v1.0.4(3mo ago)0274MITPHPPHP ^8.2

Since Jun 20Pushed 3mo agoCompare

[ Source](https://github.com/Webudvikleren/laravel-commentable)[ Packagist](https://packagist.org/packages/webudvikleren/laravel-commentable)[ RSS](/packages/webudvikleren-laravel-commentable/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

Laravel Commentable
===================

[](#laravel-commentable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0bacc293c3341ac991f9fc1df3f8b9ec45a08b35902e0103f7615283fe95cfeb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776562756476696b6c6572656e2f6c61726176656c2d636f6d6d656e7461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/webudvikleren/laravel-commentable)[![Total Downloads](https://camo.githubusercontent.com/6ae3ea436187b58598895720bbc379eb92cbea01f7b58e8f4bbd57394c1891aa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f776562756476696b6c6572656e2f6c61726176656c2d636f6d6d656e7461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/webudvikleren/laravel-commentable)[![License](https://camo.githubusercontent.com/d9b3cf810458c8a0228840ed70a8eb802921fdf9f70ae7a725f9b2eec46db6a5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f776562756476696b6c6572656e2f6c61726176656c2d636f6d6d656e7461626c652e7376673f7374796c653d666c61742d737175617265)](https://github.com/webudvikleren/laravel-commentable/blob/main/LICENSE)

**Laravel Commentable** adds a simple way to allow comments on any Eloquent model.

Features
--------

[](#features)

- Add comments to any Eloquent model
- Polymorphic relationship
- User tracking (via `user_id`)
- Publishable migration and config
- Clean and extensible architecture

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

[](#installation)

```
composer require webudvikleren/laravel-commentable
```

### Publish the migration (optional)

[](#publish-the-migration-optional)

```
php artisan vendor:publish --tag=commentable-config
php artisan migrate
```

If you don’t publish the migration, Laravel will auto-load it from the package.

Usage
-----

[](#usage)

### Step 1: Add the trait to your model

[](#step-1-add-the-trait-to-your-model)

```
use Webudvikleren\Commentable\Traits\Commentable;

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

### Step 2: Add comments

[](#step-2-add-comments)

```
$post = Post::find(1);

$post->comments()->create([
    'body' => 'This is a comment.',
    'user_id' => auth()->id(),
]);
```

### Step 3: Access comments

[](#step-3-access-comments)

```
foreach ($post->comments as $comment) {
    echo $comment->body;
}
```

Comment Model
-------------

[](#comment-model)

By default, comments are stored in the `comments` table and use the provided `Webudvikleren\Commentable\Models\Comment` model.

You can override this in your app if needed by extending the model and binding it in a service provider.

Configuration
-------------

[](#configuration)

You can publish the config file to override defaults:

```
php artisan vendor:publish --tag=commentable-config
```

Example config/commentable.php (coming soon).

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

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance80

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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

Every ~57 days

Total

5

Last Release

103d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.0.4PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![philipsorensen](https://avatars.githubusercontent.com/u/5397535?v=4)](https://github.com/philipsorensen "philipsorensen (11 commits)")

### Embed Badge

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

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

###  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)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9346.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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