Permalink
Browse files

Check if the properties is a collection (#261)

* Update Activity.php

Check before if the properties is a Collection, else we can't apply over it the toArray function

* Update Activity.php

* Update Activity.php

* Update Activity.php

* Update Activity.php
  • Loading branch information...
glorand authored and freekmurze committed Sep 12, 2017
1 parent be7e577 commit a97c09deaf3d8894e8dbb4f0cec33366d3c3beb5
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/Models/Activity.php
View
@@ -45,6 +45,10 @@ public function getExtraProperty(string $propertyName)
public function changes(): Collection
{
if (! $this->properties instanceof Collection) {
return new Collection();
}
return collect(array_filter($this->properties->toArray(), function ($key) {
return in_array($key, ['attributes', 'old']);
}, ARRAY_FILTER_USE_KEY));

0 comments on commit a97c09d

Please sign in to comment.