Upgrade Guide

Upgrading To 2.0 From 1.2

Since this is a major update only the database tables can be upgraded. This means you can keep your comments but you'll have to reinstall and update the usage.


php artisan config:clear
php artisan route:clear
php artisan cache:clear

Delete app/comments, public/vendor/comments and config/comments.php.

Edit composer.json and remove "Hazzard\\Comments\\": "app/comments/src/" and "s9e/text-formatter": "^0.4".

Edit config/app.php and remove Hazzard\Comments\CommentsServiceProvider::class from your providers array.

Run composer dumpautoload

Now follow the Installation guide but remember: DO NOT RUN php artisan migrate yet.

Once you've re-installed the comments you can continue.

Run composer require doctrine/dbal. This package is required by Laravel in order to modify columns.

Cd into laravel-comments/migrations and delete:

  • 2017_02_03_00001_create_comments_table.php
  • 2017_02_03_00002_create_comment_votes_table.php

Then create a new migration 2017_02_13_00005_update_comments_table.php:


use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class UpdateCommentsTable extends Migration
    public function up()
                ->registerDoctrineTypeMapping('enum', 'string');

        Schema::table('comments', function (Blueprint $table) {

    public function down()
        Schema::table('comments', function (Blueprint $table) {

This migration will add 2 new columns and update some old ones.

Finally, run php artisan migrate to update the comments table.

Head over to the Usage section to get started.