title: How to extend PHP Laravel model's fillable fields in a child class?
body: <p>I try to extend an extintig ˙PHP` Laravel model with some other fields, but I not found the right solution. I use PHP 7.1 with Laravel 6.2</p>
  
  <p>Here is my code, what explain what I want to do.</p>
  
  <p>The original model:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  namespace App;
  
  use App\Scopes\VersionControlScope;
  use Illuminate\Database\Eloquent\Model;
  
  class Product extends Model
  {
      protected $fillable = [
          'product_id',
          'name',
          'unit',
          // ...
      }
  
      // ... relations, custom complex functions are here
  }
  
  </code></pre>
  
  <p>And as I imagined how to extend the original model:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  namespace App;
  
  class ProductBackup extends Product
  {
      protected $fillable = array_merge(
          parent::$fillable,
          [
              'date_of_backup',
          ]
      );
  
      // ...
  }
  </code></pre>
  
  <p>But now I get <code>Constant expression contains invalid operations</code> error message.</p>
  
  <p>Can I extend shomehow my original model's <code>$fillable</code> array in the child class?</p>