asseco-voice/laravel-comments

Laravel comment system

v2.1.0 2024-01-23 12:20 UTC

This package is auto-updated.

Last update: 2024-04-23 13:15:26 UTC


README

evil_logo.png

Comments

Purpose of this repository is to enable adding comments to any Laravel model.

Installation

Require the package with composer require asseco-voice/laravel-comments. Service provider will be registered automatically.

Setup

In order to use the package, migrate the tables with artisan migrate and add Commentable trait to model you'd like to have comment support on.

use Asseco\Comment\Contracts\Commentable;

class Product extends Model implements Commentable
{
    use Commentable;
    
    // ...   
}

Standard CRUD endpoints are exposed for comment administration, however if you'd like a dedicated controller to manage CRUD actions on a specific model you need to manually create it.

Extending the package

Publishing the configuration will enable you to change package models as well as controlling how migrations behave. If extending the model, make sure you're extending the original model in your implementation.