PHPackages                             alex-oliveira/ao-comments - 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. [Admin Panels](/categories/admin)
4. /
5. alex-oliveira/ao-comments

ActivePackage[Admin Panels](/categories/admin)

alex-oliveira/ao-comments
=========================

Resources for Comments with Laravel.

08PHP

Since May 30Pushed 9y ago1 watchersCompare

[ Source](https://github.com/alex-oliveira/ao-comments)[ Packagist](https://packagist.org/packages/alex-oliveira/ao-comments)[ RSS](/packages/alex-oliveira-ao-comments/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Ao-Comments
===========

[](#ao-comments)

### 1) Installing

[](#1-installing)

```
$ composer require alex-oliveira/ao-comments

```

### 2) Configuring "config/app.php" file

[](#2-configuring-configappphp-file)

```
'providers' => [
    /*
     * Vendor Service Providers...
     */
    AoComments\ServiceProvider::class,
],

```

### 3) Create "config/ao.php" file

[](#3-create-configaophp-file)

```
return [
    .
    .
    .
    'models' => [
        'users' => App\Models\User::class,
    ],

    'tables' => [
        'users' => 'users'
    ]
    .
    .
    .
];

```

### 4) Publish migrations

[](#4-publish-migrations)

```
$ php artisan vendor:publish
$ composer dump

```

Utilization
===========

[](#utilization)

Migration
---------

[](#migration)

### Up

[](#up)

```
public function up()
{
    AoComments()->schema()->create('posts');
}

```

the same that

```
public function up()
{
    Schema::create('ao_comments_x_posts', function (Blueprint $table) {
        $table->integer('post_id')->unsigned();
        $table->foreign('post_id', 'fk_posts_x_ao_comments')->references('id')->on('posts');

        $table->bigInteger('comment_id')->unsigned();
        $table->foreign('comment_id', 'fk_ao_comments_x_posts')->references('id')->on('ao_comments_comments');

        $table->primary(['post_id', 'comment_id'], 'pk_ao_comments_x_posts');
    });
}

```

### Down

[](#down)

```
public function down()
{
    AoLogs()->schema()->drop('posts');
}

```

the same that

```
public function down()
{
    Schema::dropIfExists('ao_comments_x_posts');
}

```

Model
-----

[](#model)

```
namespace App\Models;

use AoComments\Models\Comment;
use Illuminate\Database\Eloquent\Model;

class Post extends Model
{

    /**
     * @return Comment[]|\Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function comments()
    {
        return $this->belongsToMany(Comment::class, AoComments()->schema()->table($this->getTable()));
    }

}

```

the same that

```
return $this->belongsToMany(Comment::class, 'ao_comments_x_posts');

```

Controller
----------

[](#controller)

```
namespace App\Http\Controllers\Posts;

use AoComments\Controllers\AoCommentsController;
use App\Models\Post;

class CommentsController extends AoCommentsController
{

    protected $dynamicClass = Post::class;

}

```

Routes
------

[](#routes)

```
Route::group(['prefix' => 'posts', 'as' => 'posts.'], function () {

    AoComments()->router()->controller('Posts\CommentsController')->foreign('post_id')->make();
    .
    .
    .

});

```

### Checking routes

[](#checking-routes)

```
$ php artisan route:list

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5826507?v=4)[Alex Oliveira](/maintainers/alex-oliveira)[@alex-oliveira](https://github.com/alex-oliveira)

---

Top Contributors

[![alex-oliveira](https://avatars.githubusercontent.com/u/5826507?v=4)](https://github.com/alex-oliveira "alex-oliveira (6 commits)")

### Embed Badge

![Health badge](/badges/alex-oliveira-ao-comments/health.svg)

```
[![Health](https://phpackages.com/badges/alex-oliveira-ao-comments/health.svg)](https://phpackages.com/packages/alex-oliveira-ao-comments)
```

PHPackages © 2026

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