承接 imanborumand/laravel-comments 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

imanborumand/laravel-comments

Composer 安装命令:

composer require imanborumand/laravel-comments

包简介

A package for launching comments in Laravel with the ability to connect to multiple models

README 文档

README

Comments package for Laravel

Using this package, you can easily activate comments for your models.

Installation

Install via Composer:

composer require imanborumand/laravel-comments

Now for publish migrations run:

php artisan migrate

Also publish the config file with the following command:

php artisan vendor:publish --tag="laravel-comment"

Usage

To use, just use trait Imanborumand\LaravelComments\Traits\HasComment in your models.

use Imanborumand\LaravelComments\Traits\HasComment;

class Article extends Model
{
    use HasComment;
}
$article = Article::first();

$article->storeComment('this is the first article!'); 

This package will use the authenticated user by default. Of course, if you wish, you can save a favorite user as a comment sender as follows.

$article->storeComment('Hello, world!', user: User::first());

You can also add a child comment as follows:

$article->storeComment('Hello, world!', parent: Comment::find(10));

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固