title: Laravel 5: php artisan migrate:refresh
body: <p>I am working on a laravel project and each time I change my table (add or remove column) and run <code>php artisan migrate:refresh</code>. I get this error:</p>
  
  <blockquote>
    <p>[Symfony\Component\Debug\Exception\FatalErrorException]   Can't use
    method return value in write context</p>
  </blockquote>
  
  <p>Solution tried:</p>
  
  <ol>
  <li>run <code>composer dump-autoload</code> (Fails)</li>
  <li>Drop table in database, delete the migration file and restart again (works)</li>
  </ol>
  
  <p>Previous migration file:</p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateCommentsTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('comments', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;integer('post_id');
              $table-&gt;string('body');
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('comments');
      }
  }
  </code></pre>
  
  <p>Changed migration file:</p>
  
  <pre><code>    &lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateCommentsTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('comments', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;integer('user_id');
              $table-&gt;integer('post_id');
              $table-&gt;string('body');
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('comments');
      }
  }
  </code></pre>
  
  <p>I added the user_id in the change file in the up function</p>