2017-25 © Pedro Peláez
 

library comment

comments syetem for Laravel 5

image

webazin/comment

comments syetem for Laravel 5

  • Saturday, May 5, 2018
  • by webazin
  • Repository
  • 0 Watchers
  • 1 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 50 % Grown

The README.md

Latest Stable Version License, (*1)

Total Downloads, (*2)

Laravel Comment

comment system for laravel 5, (*3)

Installation

First, pull in the package through Composer., (*4)

composer require webazin/Comment

or add this in your project's composer.json file ., (*5)

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

And then include the service provider within app/config/app.php., (*6)

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

Getting started

After the package is correctly installed, you need to generate the migration., (*7)

php artisan comment:migration

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

php artisan migrate

After the migration, one new table will be present, comments., (*9)

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.

The Versions

05/05 2018

dev-master

9999999-dev

comments syetem for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar webazin

laravel comment commentable

05/05 2018

dev-mahdi4187-patch-1

dev-mahdi4187-patch-1

comments syetem for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar webazin

laravel comment commentable

02/05 2018

v1.0

1.0.0.0

comments syetem for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar webazin

laravel comment commentable