承接 webazin/comment 相关项目开发

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

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

webazin/comment

Composer 安装命令:

composer require webazin/comment

包简介

comments syetem for Laravel 5

README 文档

README

Latest Stable Version License

Total Downloads

Laravel Comment

comment system for laravel 5

Installation

First, pull in the package through Composer.

composer require webazin/Comment

or add this in your project's composer.json file .

"require": {
  "webazin/Comment": "^1.0",
}

And then include the service provider within app/config/app.php.

'providers' => [
    webazin\Comment\CommentServiceProvider::class
];

Getting started

After the package is correctly installed, you need to generate the migration.

php artisan comment:migration

It will generate the <timestamp>_create_comments_table.php migration. You may now run it with the artisan migrate command:

php artisan migrate

After the migration, one new table will be present, comments.

Usage

Setup a Model

<?php

namespace App;

use webazin\comment\Traits\Commentable as Comment;
use Illuminate\Database\Eloquent\Model;

class Post extends Model implements Comment
{
    use Comment;
}

Create a comment

$user = User::first();
$post = Post::first();

$comment = $post->comment([
    'comment' => 'comment text'
], $user);

dd($comment);

Create or update a unique comment

$user = User::first();
$post = Post::first();

$comment = $post->commentUnique([
    'comment' => 'comment text'
], $user);

dd($comment);

Update a comment

$comment = $post->updateComment(1, [
    'comment' => 'comment text'
]);

Delete a comment:

$post->deleteComment(1);

fetch the Sum comment:

$post->commentCount

// $post->commentCount() also works for this.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固