Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function getChangedValues(): Collection |
||
31 | { |
||
32 | if (!isset(static::$logChangesOnAttributes)) { |
||
33 | return collect(); |
||
34 | } |
||
35 | |||
36 | return collect($this->getChangedAttributeNames()) |
||
37 | ->filter(function (string $attributeName) { |
||
38 | return collect(static::$logChangesOnAttributes)->contains($attributeName); |
||
39 | }) |
||
40 | ->map(function (string $changedAttributeName) { |
||
41 | return [ |
||
42 | 'old' => $this->oldValues[$changedAttributeName], |
||
43 | 'new' => $this->newValues[$changedAttributeName], |
||
44 | ]; |
||
45 | }); |
||
46 | } |
||
47 | } |
||
48 |