2017 © Pedro Peláez
 

package laravel-comments

Comments package for Laravel

image

muan/laravel-comments

Comments package for Laravel

  • Wednesday, May 23, 2018
  • by mustardandrew
  • Repository
  • 1 Watchers
  • 3 Stars
  • 1 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Maun Laravel Comments package

Maintainability, (*1)

Used for create comments., (*2)

Requirements

  • "php": ">=7.0"

Install

1) Type next command in your terminal:, (*3)

composer require muan/laravel-comments

2) Add the service provider to your config/app.php file in section providers:, (*4)

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

'providers' => [
    // ...
    Muan\Comments\Providers\CommentsServiceProvider::class,
    // ...
],

3) Use the following trait on your User model, (*6)

// Use trait
use Muan\Comments\Traits\CanComment;

class User extends Authenticatable
{
    use CanComment;

    // ...
}

Add Commentable trait to your commentable model(s)., (*7)

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., (*8)

The Versions

23/05 2018

dev-master

9999999-dev

Comments package for Laravel

  Sources   Download

MIT

The Requires

  • php >=7.0

 

by Mustard Andrew

laravel comments messages package

23/05 2018

0.1.0

0.1.0.0

Comments package for Laravel

  Sources   Download

MIT

The Requires

  • php >=7.0

 

by Mustard Andrew

laravel comments messages package