PHPackages                             baklysystems/laravel-commentable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. baklysystems/laravel-commentable

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

baklysystems/laravel-commentable
================================

Allows for threaded comments to be added to multiple and different models.

v2.0(6y ago)111MITPHPPHP &gt;=5.4

Since Sep 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/baklysystems/laravel-commentable)[ Packagist](https://packagist.org/packages/baklysystems/laravel-commentable)[ RSS](/packages/baklysystems-laravel-commentable/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (4)Versions (2)Used By (0)

Laravel Commentable
===================

[](#laravel-commentable)

Allows for threaded comments to be added to multiple and different models within your app for Laravel 4 and 5.

For Laravel 4, look at the [1.0 branch](https://github.com/RomainLanz/laravel-commentable/tree/1.0).

This package use Nested Sets pattern with [Baum](https://github.com/etrepat/baum).

[More information about Nested Sets](http://en.wikipedia.org/wiki/Nested_set_model)

Installation
============

[](#installation)

Edit your project's composer.json file to require `lanz/laravel-commentable`.

```
"require": {
  "lanz/laravel-commentable": "~2.0"
}

```

Next, update Composer from the terminal.

```
composer update

```

As with most Laravel packages you'll need to register Commentable *service provider*. In your `config/app.php` add `'Lanz\Commentable\CommentableServiceProvider'` to the end of the `$providers` array.

```
'providers' => [

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    'Lanz\Commentable\CommentableServiceProvider',

],
```

Getting started
===============

[](#getting-started)

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

```
php artisan commentable:migration

```

It will generate the `_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
=====

[](#usage)

You need to set on your model that it acts as commentable.

```
