定制 muan/laravel-comments 二次开发

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

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

muan/laravel-comments

Composer 安装命令:

composer require muan/laravel-comments

包简介

Comments package for Laravel

README 文档

README

Maintainability

Used for create comments.

Requirements

  • "php": ">=7.0"

Install

  1. Type next command in your terminal:
composer require muan/laravel-comments
  1. Add the service provider to your config/app.php file in section providers:

Laravel 5.5 uses Package Auto-Discovery, so does not require you to manually add the ServiceProvider.

'providers' => [
    // ...
    Muan\Comments\Providers\CommentsServiceProvider::class,
    // ...
],
  1. Use the following trait on your User model
// Use trait
use Muan\Comments\Traits\CanComment;
 
class User extends Authenticatable
{
    use CanComment;
    
    // ...
}

Add Commentable trait to your commentable model(s).

use Muan\Comments\Traits\Commentable;

Usage

$user = App\User::find(1);
$product = App\Product::find(1);

// Add comment
$comment = $user->addComment($product, 'Lorem ipsum...');

// or
$comment = $product->addComment($user, 'Lorem ipsum...');

// Approve comment
$comment->approve();

// get comments
$comments = $user->comments;

// get comments
$comments = $product->comments;

License

Muan Laravel Admin package is licensed under the MIT License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-05-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固