title: TDD Laravel - Feature test in laravel and spatie/laravel-activitylog get JSON encoding errors
body: <p>I'm writing some tests to my models in laravel and i've getting some troubles when i enable Activity Log by using <a href="https://github.com/spatie/laravel-activitylog" rel="nofollow noreferrer">spatie/laravel-activitylog</a>.</p>
  
  <p>So, i create a user, using <code>Factory</code>, i authenticate in system, and when i'll try to logout, i get this error:</p>
  
  <blockquote>
    <p><strong>1) Tests\Feature\Usuario\CriarUsuarioTest::testAcessaPaginaDeRegistro
    Illuminate\Database\Eloquent\JsonEncodingException: Unable to encode attribute [properties] for model [Spatie\Activitylog\Models\Activity] to JSON: Type is not supported.</strong></p>
  </blockquote>
  
  <p>My test <code>TestCase.php</code>:</p>
  
  <pre><code>protected function setUp()
  {
      parent::setUp();
      $this-&gt;user = create('App\Models\Usuario');
      $this-&gt;singIn($this-&gt;user)
           -&gt;disableExceptionHandling();
  
  }
  
  ...
  ...
  ...
  
  protected function singIn($user)
  {
      $this-&gt;actingAs($user);
      return $this;
  }
  
  protected function singOut()
  {
      // routeLogout() goes to '/logout' route.
      $this-&gt;post(routeLogout()); // &lt;- Here, where the error occurs
      return $this;
  }
  </code></pre>
  
  <p>My <code>App/Models/Usuario.php</code> model:</p>
  
  <pre><code>namespace App\Models;
  
  use Illuminate\Notifications\Notifiable;
  use Illuminate\Database\Eloquent\SoftDeletes;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  use Webpatser\Uuid\Uuid;
  use Spatie\Activitylog\Traits\LogsActivity;
  
  class Usuario extends Authenticatable
  {
      use LogsActivity, Notifiable, SoftDeletes;
      protected $table = 'usuario';
      protected $fillable = [/*...*/] ; // I remove this to post here on SO
      protected static $logFillable = true;
      public $timestamps = true;
      protected $dates = [
          'created_at',
          'updated_at',
          'deleted_at'
      ];
      protected static function boot() 
      {
          // Handle the \LogsActivity boot method
          parent::boot();
          static::saving(function ($usuario){
              $usuario-&gt;uuid = Uuid::generate()-&gt;string;
          });
      }
      public function getRouteKeyName()
      {
          return 'uuid';
      }
  }
  </code></pre>
  
  <p>My <code>config/activitylog.php</code> file:</p>
  
  <pre><code>return [
      'enabled' =&gt; env('ACTIVITY_LOGGER_ENABLED', true),
      'delete_records_older_than_days' =&gt; 365,
      'default_log_name' =&gt; 'default',
      'default_auth_driver' =&gt; null,
      'subject_returns_soft_deleted_models' =&gt; false,
      'activity_model' =&gt; \Spatie\Activitylog\Models\Activity::class,
  ];
  </code></pre>
  
  <p>My <code>phpunit.xml</code> file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;phpunit backupGlobals="false" 
               backupStaticAttributes="false" 
               bootstrap="vendor/autoload.php" 
               colors="true" 
               convertErrorsToExceptions="true" 
               convertNoticesToExceptions="true" 
               convertWarningsToExceptions="true" 
               processIsolation="false" 
               stopOnFailure="false"&gt;
                   &lt;testsuites&gt;
                        &lt;testsuite name="Feature"&gt;
                             &lt;directory suffix="Test.php"&gt;./tests/Feature&lt;/directory&gt;
                        &lt;/testsuite&gt;
                        &lt;testsuite name="Unit"&gt;
                             &lt;directory suffix="Test.php"&gt;./tests/Unit&lt;/directory&gt;
                        &lt;/testsuite&gt;
                   &lt;/testsuites&gt;
                   &lt;filter&gt;
                      &lt;whitelist processUncoveredFilesFromWhitelist="true"&gt;
                          &lt;directory suffix=".php"&gt;./app&lt;/directory&gt;
                      &lt;/whitelist&gt;
                   &lt;/filter&gt;
                   &lt;php&gt;
                      &lt;env name="APP_ENV" value="testing"/&gt;
                      &lt;env name="CACHE_DRIVER" value="array"/&gt;
                      &lt;env name="SESSION_DRIVER" value="array"/&gt;
                      &lt;env name="QUEUE_DRIVER" value="sync"/&gt;
                      &lt;env name="API_DEBUG" value="true"/&gt;
                      &lt;env name="memory_limit" value="512M"/&gt;
                      &lt;env name="APP_DATABASE" value="test"/&gt;
                   &lt;/php&gt;
      &lt;/phpunit&gt;
  </code></pre>
  
  <p>My <code>create_activity_log_migration</code> file:</p>
  
  <pre><code>use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateActivityLogTable extends Migration
  {
      /**
       * Run the migrations.
       */
      public function up()
      {
          Schema::create('activity_log', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;string('log_name')-&gt;nullable();
              $table-&gt;string('description');
              $table-&gt;integer('subject_id')-&gt;nullable();
              $table-&gt;string('subject_type')-&gt;nullable();
              $table-&gt;integer('causer_id')-&gt;nullable();
              $table-&gt;string('causer_type')-&gt;nullable();
              $table-&gt;text('properties')-&gt;nullable();
              $table-&gt;timestamps();
  
              $table-&gt;index('log_name');
          });
      }
  
      /**
       * Reverse the migrations.
       */
      public function down()
      {
          Schema::drop('activity_log');
      }
  }
  </code></pre>
  
  <p>I notice then when i disable Activity Log for model, its work fine. And, when i use the system by tinker or browser, logs also work as well.</p>