agilepixels/laravel-commentable

A package to add comments to Eloquent Models

Installs: 842

Dependents: 1

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 1

Open Issues: 1

pkg:composer/agilepixels/laravel-commentable

v1.3.0 2021-02-25 08:59 UTC

This package is auto-updated.

Last update: 2025-09-25 19:50:35 UTC


README

Installation

You can install the package via composer:

composer require agilepixels/laravel-commentable

You must publish the migration with:

php artisan vendor:publish --provider="AgilePixels\Commentable\CommentableServiceProvider" --tag="migrations"

Migrate the comments table:

php artisan migrate

Optionally you can publish the config-file with:

php artisan vendor:publish --provider="AgilePixels\Commentable\CommentableServiceProvider" --tag="config"

Using the traits

To enable the comments for a model, use the AgilePixels\Commentable\Traits\HasComments trait on the model.

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use AgilePixels\Commentable\Traits\HasComments;

class Product extends Model
{
    use HasComments;
}

You can use the AgilePixels\Commentable\Traits\AddsComments on the author model:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use AgilePixels\Commentable\Traits\AddsComments;

class User extends Model
{
    use AddsComments;
}