rockbuzz/lara-comments 问题修复 & 功能扩展

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

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

rockbuzz/lara-comments

Composer 安装命令:

composer require rockbuzz/lara-comments

包简介

Comments is a package for managing comments on features like Posts

README 文档

README

Comments is a package for managing comments on features like Posts

Requirements

PHP >=7.3

Install

$ composer require rockbuzz/lara-comments
php artisan vendor:publish --provider="Rockbuzz\LaraComments\ServiceProvider"
php artisan migrate

Add the Commenter and Commentable trait in models for:

use Rockbuzz\LaraComments\Traits\{Commentable, Commenter};

class User extends Authenticatable
{
    use Commenter;
}

class Post extends Model
{
    use Commentable;
}

Usage

User

$user->comments(): HasMany;
$user->commentOn(Model $commentable, string $body, string $title = null): Comment;
$user->likes(): BelongsToMany;
$user->likeTo(Comment $comment): void;
$user->dislikeTo(Comment $comment): void;

Post

$post->comments(): MorphMany;
$post->hasComments(): bool;
$post->asPending($comment): void;
$post->approve($comment): void;
$post->unapprove($comment): void;

Comment

$comment->commenter(): BelongsTo;
$comment->commentable(): MorphTo;
$comment->children(): HasMany;
$comment->parent(): BelongsTo
$comment->isPending(): bool;
$comment->isApprove(): bool;
$comment->isUnapprove(): bool;

Scope

Comment::approved();
Comment::pending();
Comment::unapproved();

Events

\Rockbuzz\LaraComments\Events\AsPendingEvent::class;
\Rockbuzz\LaraComments\Events\ApprovedEvent::class;
\Rockbuzz\LaraComments\Events\UnapprovedEvent::class;

License

The Lara Comments is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-03-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固