title: Extending spatie laravel-activitylogs Activity Model and adding new fillable
body: <p>I'm working on Laravel 5.4 application and trying to install spatie/laravel-activitylog v1.16 (old version since I'm not sure if the newer v2.4.3 will working with 5.4) <a href="https://github.com/spatie/laravel-activitylog/pull/119/commits/d35c100140e4eb5328d4ace66047a96e751411d6" rel="nofollow noreferrer">link to package</a></p>
  
  <p>My problem is the package says I can add a causer using the package CausesActivity Trait. I added it to the Company model because every model has a company_id attribute but that didn't work. 
  I have a Company with many users would like to add the company id to the table on creating a log.
  I created a CompanyLogActivity model that extends the Activity Model and added company_id column to the activity_log table from the (package) and added the new model to the config file. </p>
  
  <p>I then tried:</p>
  
  <p>Adding belongsToTenant Trait with no use </p>
  
  <pre><code>use Illuminate\Database\Eloquent\Model;  
  use Spatie\Activitylog\Models\Activity;  
  use HipsterJazzbo\Landlord\BelongsToTenants;   
  class CompanyActivityLogs extends Activity  
  {  
      use BelongsToTenants;  
      protected $table = ['activity_log'];  
      public $tenantColumns = ['company_id'];  
   }    
  </code></pre>
  
  <p>Using $fillable on the model and observing for creating or saving to fill company_id</p>
  
  <pre><code>&lt;?php
  
  namespace App\Observers;  
  use App\CompanyActivityLogs;  
  use Auth;  
  use Spatie\Activitylog\Models\Activity;  
  class CompanyActivity  
  {  
  public function creating($model)  
  {  
      $model-&gt;fill(['company_id' =&gt; Auth::user()-&gt;company_id])-&gt;save();  
  }  
  public function updating($model) {  
      $model-&gt;fill(['company_id' =&gt; Auth::user()-&gt;company_id])-&gt;save();  
  }  
  </code></pre>
  
  <p>Then in my new CompanyActivityLogs model </p>
  
  <pre><code>public static function boot() {  
   parent::boot();  
  CompanyActivityLogs::observe(new CompanyActivity()); 
  }
  </code></pre>
  
  <p>That didn't work and I thought was gonna be a great solution. I tried switching out CompanyActivityLogs for Activity (the parent model ) in the observe statement and that didn't work.</p>
  
  <p>I tried to add the to the extended model </p>
  
  <pre><code>public static function boot()
   {
      parent::boot();
      static::creating(function($model)
      {
  
          $model-&gt;created_by = public static function boot()
   {
      parent::boot();
      static::creating(function($model)
      {         
          $model-&gt;created_by = Auth::user()-&gt;company_id;
          //also tried  $model-&gt;save(); here
  
      });      
  };
  </code></pre>
  
  <p>Lastly I tried  appending it to the parent::array</p>
  
  <pre><code>protected $fillable = ['company_id'];  
  public function toArray()  
  {  
      $array = parent::toArray();  
      foreach ($this-&gt;getMutatedAttributes() as $key)  
      {  
          if ( ! array_key_exists($key, $array)) {  
              $array['company_id'] = Auth::user()-&gt;company_id;  
          }  
      } 
      return $array;  
  }
  </code></pre>
  
  <p>I tried so many different ways thinking one of them would help. </p>