centrex/livewire-comments 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

centrex/livewire-comments

最新稳定版本:v2.0.0

Composer 安装命令:

composer require centrex/livewire-comments

包简介

Manege comments with livewire in laravel

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Contents

Some Features Highlight

  • Easy to integrate
  • Supports Laravel 10+
  • Supports Livewire 3
  • Livewire powered commenting system
  • Tailwind UI
  • Add comments to any model
  • Nested Comments
  • Comments Pagination
  • Youtube style Like/unlike feature
  • Guest like/unlike of comments (based on IP & UserAgent)
  • Mention User with @ in Replies/Edits

Prerequisites

Installation

You can install the package via composer:

composer require centrex/livewire-comments

You can run the migrations with:

php artisan migrate

You can publish the config file with:

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

you can publish tailwind.config.js file,

This package utilizes TailwindCSS, and use some custom configurations. You can publish package's tailwind.config. js file by running the following command:

php artisan vendor:publish --tag="comments-tailwind-config"

Usage

In your model, where you want to integrate comments, simply add the Commentable trait in that model. For example:

use Centrex\LivewireComments\Traits\Commentable;

class Article extends Model
{
    use Commentable;
}

Next, in your view, pass in the livewire comment component. For example, if your view file is articles/show.blade. php. We can add the following code:

<livewire:comments :model="$article"/>

Additionally, add the HasUserAvatar trait in App\Models\User, to use avatars:

use Centrex\LivewireComments\Traits\HasUserAvatar;

class User extends Model
{
    use HasUserAvatar;
}

Testing

🧹 Keep a modern codebase with Pint:

composer lint

✅ Run refactors using Rector

composer refacto

⚗️ Run static analysis using PHPStan:

composer test:types

✅ Run unit tests using PEST

composer test:unit

🚀 Run the entire test suite:

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 2.45k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-13