2017 © Pedro Peláez
 

library laravel-comments

Extension for actuallymab/laravel-comment package. Allow comment as guest and add other meta-info.

image

nutnet/laravel-comments

Extension for actuallymab/laravel-comment package. Allow comment as guest and add other meta-info.

  • Tuesday, September 26, 2017
  • by maximkou
  • Repository
  • 2 Watchers
  • 0 Stars
  • 1,779 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 23 % Grown

The README.md

Extension for actuallymab/laravel-comment

Original laravel-comment package is a good start point for creating commenting system on laravel, but package doesn't allow(out of the box) attach some meta about user or comment, or comment as guest. This extension fix this issues., (*1)

Install and configure

To install package, run:, (*2)

composer require nutnet/laravel-comments

Next, enable package by adding service provider to your app config:, (*3)

// config/app.php
'providers' => [
    ...
    Nutnet\LaravelComments\ServiceProvider::class,
    ...
];

Optionally add alias for Nutnet\LaravelComments\Facades\Commenter facade., (*4)

Usage

All usage is identical to original package, except some moments:, (*5)

  1. Use Nutnet\LaravelComments\CanComment trait instead of original.
  2. Use Nutnet\LaravelComments\Commentable trait instead of original.
  3. Use Nutnet\LaravelComments\Models\Comment model instead of original.
As authorized user:
use Nutnet\LaravelComments\Services\Commenter;
use Nutnet\LaravelComments\Facades\Commenter as CommenterFacade;

// ... some other code

public function comment(Commenter $commenter)
{
    // variant 1
    $commenter->comment($product, 'Test comment', $user, ['meta' => 'test']);

    // variant 2, without meta
    $user->comment($product, 'Test comment', $rate);

    // variant 3
    CommenterFacade::comment($product, 'Test comment', $user, ['meta' => 'test']);
}
As guest:
use Nutnet\LaravelComments\Services\Commenter;
use Nutnet\LaravelComments\Facades\Commenter as CommenterFacade;

// ... some other code

public function comment(Commenter $commenter)
{
    // variant 1
    $commenter->commentAsGuest($product, 'Test comment', ['meta' => 'test']);

    // variant 2, without meta
    CommenterFacade::commentAsGuest($product, 'Test comment', ['meta' => 'test']);
}

The Versions

26/09 2017

dev-master

9999999-dev

Extension for actuallymab/laravel-comment package. Allow comment as guest and add other meta-info.

  Sources   Download

MIT

The Requires

 

by Avatar maximkou

laravel comments nutnet maximkou

26/09 2017

0.1.4

0.1.4.0

Extension for actuallymab/laravel-comment package. Allow comment as guest and add other meta-info.

  Sources   Download

MIT

The Requires

 

by Avatar maximkou

laravel comments nutnet maximkou

26/09 2017

0.1.3

0.1.3.0

Extension for actuallymab/laravel-comment package. Allow comment as guest and add other meta-info.

  Sources   Download

MIT

The Requires

 

by Avatar maximkou

laravel comments nutnet maximkou

26/09 2017

0.1.2

0.1.2.0

Extension for actuallymab/laravel-comment package. Allow comment as guest and add other meta-info.

  Sources   Download

MIT

The Requires

 

by Avatar maximkou

laravel comments nutnet maximkou

26/09 2017

0.1.1

0.1.1.0

Extension for actuallymab/laravel-comment package. Allow comment as guest and add other meta-info.

  Sources   Download

MIT

The Requires

 

by Avatar maximkou

laravel comments nutnet maximkou

26/09 2017

0.1.0

0.1.0.0

Extension for actuallymab/laravel-comment package. Allow comment as guest and add other meta-info.

  Sources   Download

MIT

The Requires

 

by Avatar maximkou

laravel comments nutnet maximkou