PHPackages                             carropublic/discussion - 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. carropublic/discussion

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

carropublic/discussion
======================

Discussion like comments

4.0.3(6mo ago)1126.3k↓69.4%3[4 PRs](https://github.com/carro-public/discussion/pulls)MITPHP

Since Dec 14Pushed 6mo ago4 watchersCompare

[ Source](https://github.com/carro-public/discussion)[ Packagist](https://packagist.org/packages/carropublic/discussion)[ Docs](https://github.com/carropublic/discussion)[ RSS](/packages/carropublic-discussion/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (4)Versions (25)Used By (0)

Discussion
==========

[](#discussion)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d41d036b99e797f199bf1685d8cc21feccf66d7c757571a55f1743a392dab792/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636172726f7075626c69632f64697363757373696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/carropublic/discussion)[![Total Downloads](https://camo.githubusercontent.com/9b678cb5d0686dda3eea3c5982754e64b2b23cfab3ae27c828ef335bb3459add/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636172726f7075626c69632f64697363757373696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/carropublic/discussion)

[![Overview explanation of how this package work with image.](example.png)](example.png)

Discussion is nested discussion with approve/disapprove feature. Discussion inside the discussion, like the above image.

Take a look at [contributing.md](contributing.md) to see a to do list.

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

[](#installation)

Via Composer

```
$ composer require carropublic/discussion
```

The package will automatically register itself.

You can publish the migration with:

```
php artisan vendor:publish --provider="CarroPublic\Discussion\DiscussionServiceProvider" --tag="migrations"
```

After the migration has been published you can create the media-table by running the migrations:

```
php artisan migrate
```

You can publish the config-file with:

```
php artisan vendor:publish --provider="CarroPublic\Discussion\DiscussionServiceProvider" --tag="config"
```

Usage
-----

[](#usage)

Get lists of discussions which approve.

```
$post->discussions()->approve()->get()
```

Get lists of discussions which got disapprove.

```
$post->discussions()->disApproved()->get()
```

Get lists of discussions for both approve and disapprove.

```
$post->discussions
```

### Register the Model

[](#register-the-model)

In order to receive/retrieve discussions from the specific model, add the `HasDiscussion` trait to the model class. In our case we choose `Post` as main discussion.

```
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use CarroPublic\Discussion\Traits\HasDiscussion;

class Post extends Model
{
    use HasDiscussion;
    ...
}
```

### Create Discussions

[](#create-discussions)

To create a discussion to your discussable models (in this case Post model), you can use `discussion` method like the following.

```
$post = Post::find(1);
$post->discussion('Hello World! This is a discussion');
```

You can also use `discussAsUser` method which need to pass the user object. See example in the following.

```
$user = User::find(1);
$post->discussAsUser($user, 'Hi! This is a simple discussion');
```

### Retrieving Discussion

[](#retrieving-discussion)

After you finish creating discussion, You can retrieve all your discussion like the following.

```
$post->discussions
```

You can filter only by approve or disapprove like the following.

```
#For approve discussion
$post->discussions()->approved()->get();

#For disapprove discussion
$post->discussions()->disApproved()->get();
```

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Carro](https://github.com/carropublic)
- [All Contributors](../../contributors%5D)
- [Laravel Comment](https://github.com/beyondcode/laravel-comments)

Take Lots of reference from [Laravel Comment](https://github.com/beyondcode/laravel-comments) package. And modify base on what our need.

License
-------

[](#license)

license. Please see the [license file](license.md) for more information.

-

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance66

Regular maintenance activity

Popularity34

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 63.2% 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 ~142 days

Recently: every ~163 days

Total

19

Last Release

200d ago

Major Versions

1.0.2 → 2.0.02020-07-06

2.0.0 → 3.0.02020-10-26

0.1.1.x-dev → 4.0.02023-05-24

3.1.2 → 4.0.12024-02-27

3.1.6 → 4.0.22024-03-18

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5352704?v=4)[Si Thu Aung](/maintainers/sithuaung)[@sithuaung](https://github.com/sithuaung)

![](https://www.gravatar.com/avatar/157df3dda57b84fda6cf5c2da53974dc7eb9299ce8e27fffb6b0b88112358491?d=identicon)[setkyar](/maintainers/setkyar)

![](https://www.gravatar.com/avatar/02779007c1c12011f139028969142b28581328997648153cdcc317fd2b9bd8cb?d=identicon)[aungkoko96](/maintainers/aungkoko96)

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

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

![](https://avatars.githubusercontent.com/u/169651273?v=4)[carro-tech](/maintainers/carro-tech)[@carro-tech](https://github.com/carro-tech)

---

Top Contributors

[![setkyar](https://avatars.githubusercontent.com/u/4435358?v=4)](https://github.com/setkyar "setkyar (12 commits)")[![sithuaung](https://avatars.githubusercontent.com/u/5352704?v=4)](https://github.com/sithuaung "sithuaung (4 commits)")[![danielnguyen1612](https://avatars.githubusercontent.com/u/1705651?v=4)](https://github.com/danielnguyen1612 "danielnguyen1612 (3 commits)")

---

Tags

discussiondiscussion-boardnoteslaraveldiscussion

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/carropublic-discussion/health.svg)

```
[![Health](https://phpackages.com/badges/carropublic-discussion/health.svg)](https://phpackages.com/packages/carropublic-discussion)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M10](/packages/renatomarinho-laravel-page-speed)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k12.5k1](/packages/vinkius-labs-laravel-page-speed)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90142.9k](/packages/emargareten-inertia-modal)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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