File tree Expand file tree Collapse file tree 3 files changed +16
-16
lines changed
Expand file tree Collapse file tree 3 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ protected function convertAttributesForJson(array $attributes = []): array
143143 $ attributes = parent ::convertAttributesForJson ($ attributes );
144144
145145 // If the model has a SID set, we need to convert it to its
146- // string format, due to it being in binary. Otherwise
146+ // string format, due to it being in binary. Otherwise,
147147 // we will receive a JSON serialization exception.
148148 if (isset ($ attributes [$ this ->sidKey ])) {
149149 $ attributes [$ this ->sidKey ] = [$ this ->getConvertedSid (
@@ -161,15 +161,6 @@ protected function convertAttributesFromJson(array $attributes = []): array
161161 {
162162 $ attributes = parent ::convertAttributesFromJson ($ attributes );
163163
164- // Here we are converting the model's GUID and SID attributes
165- // back to their original values from serialization, so that
166- // their original value may be used and compared against.
167- if (isset ($ attributes [$ this ->guidKey ])) {
168- $ attributes [$ this ->guidKey ] = [$ this ->getBinaryGuid (
169- Arr::first ($ attributes [$ this ->guidKey ])
170- )];
171- }
172-
173164 if (isset ($ attributes [$ this ->sidKey ])) {
174165 $ attributes [$ this ->sidKey ] = [$ this ->getBinarySid (
175166 Arr::first ($ attributes [$ this ->sidKey ])
Original file line number Diff line number Diff line change @@ -113,9 +113,9 @@ public function attributesToArray(): array
113113 */
114114 public function arrayToOriginal (array $ attributes ): array
115115 {
116- return $ this ->decodeAttributes (
117- $ this -> convertAttributesFromJson ( $ attributes )
118- );
116+ $ attributes = $ this ->decodeAttributes ($ attributes );
117+
118+ return $ this -> convertAttributesFromJson ( $ attributes );
119119 }
120120
121121 /**
@@ -125,9 +125,9 @@ public function arrayToAttributes(array $attributes): array
125125 {
126126 $ attributes = $ this ->restoreDateAttributesFromArray ($ attributes );
127127
128- return $ this ->decodeAttributes (
129- $ this -> convertAttributesFromJson ( $ attributes )
130- );
128+ $ attributes = $ this ->decodeAttributes ($ attributes );
129+
130+ return $ this -> convertAttributesFromJson ( $ attributes );
131131 }
132132
133133 /**
Original file line number Diff line number Diff line change @@ -527,6 +527,15 @@ protected function convertAttributesForJson(array $attributes = []): array
527527 */
528528 protected function convertAttributesFromJson (array $ attributes = []): array
529529 {
530+ // Here we are converting the model's GUID and SID attributes
531+ // back to their original values from serialization, so that
532+ // their original value may be used and compared against.
533+ if (isset ($ attributes [$ this ->guidKey ])) {
534+ $ attributes [$ this ->guidKey ] = [$ this ->getBinaryGuid (
535+ Arr::first ($ attributes [$ this ->guidKey ])
536+ )];
537+ }
538+
530539 return $ attributes ;
531540 }
532541
You can’t perform that action at this time.
0 commit comments