定制 akira/laravel-commentable 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

akira/laravel-commentable

Composer 安装命令:

composer require akira/laravel-commentable

包简介

Commentable is a lightweight and flexible comment system package designed to seamlessly integrate into any Laravel project. Whether you’re building a blog, a forum, or a platform like DevHunter – this package makes it incredibly easy to make any model commentable.

README 文档

README

Laravel Commentable

Packagist Version downloads tests license php

Laravel Commentable is a lightweight comment system for Laravel applications. It adds comments, replies, reactions, and moderation to Eloquent models through small, typed traits.

Install

composer require akira/laravel-commentable
{
  "require": {
    "akira/laravel-commentable": "^0.2"
  }
}

Publish and run the migrations:

php artisan vendor:publish --tag="commentable-migrations"
php artisan migrate

Publish the config when you need custom table or model classes:

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

Quick start

use Akira\Commentable\Concerns\Commentable;
use Akira\Commentable\Concerns\Commenter;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\User as Authenticatable;

final class Post extends Model
{
    use Commentable;
}

final class User extends Authenticatable
{
    use Commenter;
}

$comment = $user->comment($post, 'Laravel 13 support is ready.');

$reply = $user->reply($comment, 'Confirmed with the package test suite.');

$post->comments()->where('approved', true)->get();

Documentation

Testing

composer test

Changelog

Please see CHANGELOG.md for what has changed recently. The changelog is generated from conventional commits via git-cliff on every release tag.

Contributing

Please see CONTRIBUTING.md for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see LICENSE.md for more information.

统计信息

  • 总下载量: 682
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固