File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ public function getRelatedBinaryKeyName($attribute)
9696 {
9797 $ suffix = $ this ->getUuidSuffix ();
9898
99- return preg_match ('/(?:uu)?id/i ' , $ attribute ) !== null ? "{$ attribute }{$ suffix }" : $ attribute ;
99+ return preg_match ('/(?:uu)?id/i ' , $ attribute ) ? "{$ attribute }{$ suffix }" : $ attribute ;
100100 }
101101
102102 public function getAttribute ($ key )
@@ -155,16 +155,24 @@ public function getUuidAttributes()
155155
156156 public function getUuidTextAttribute (): ?string
157157 {
158- if (! $ this ->exists ) {
158+ $ key = $ this ->getKeyName ();
159+
160+ if (! $ this ->exists || is_array ($ key )) {
159161 return null ;
160162 }
161163
162- return static ::decodeUuid ($ this ->{$ this -> getKeyName () });
164+ return static ::decodeUuid ($ this ->{$ key });
163165 }
164166
165167 public function setUuidTextAttribute (string $ uuid )
166168 {
167- $ this ->{$ this ->getKeyName ()} = static ::encodeUuid ($ uuid );
169+ $ key = $ this ->getKeyName ();
170+
171+ if (is_array ($ key )) {
172+ return ;
173+ }
174+
175+ $ this ->{$ key } = static ::encodeUuid ($ uuid );
168176 }
169177
170178 public function getQueueableId ()
You can’t perform that action at this time.
0 commit comments