@@ -223,36 +223,37 @@ public function getCasts()
223223 /**
224224 * {@inheritdoc}
225225 */
226- public function originalIsEquivalent ($ key, $ current )
226+ public function originalIsEquivalent ($ key )
227227 {
228228 if (! array_key_exists ($ key , $ this ->original )) {
229229 return false ;
230230 }
231231
232- $ original = $ this ->getOriginal ($ key );
232+ $ attribute = Arr::get ($ this ->attributes , $ key );
233+ $ original = Arr::get ($ this ->original , $ key );
233234
234- if ($ current === $ original ) {
235+ if ($ attribute === $ original ) {
235236 return true ;
236237 }
237238
238- if (null === $ current ) {
239+ if (null === $ attribute ) {
239240 return false ;
240241 }
241242
242243 if ($ this ->isDateAttribute ($ key )) {
243- $ current = $ current instanceof UTCDateTime ? $ this ->asDateTime ($ current ) : $ current ;
244+ $ attribute = $ attribute instanceof UTCDateTime ? $ this ->asDateTime ($ attribute ) : $ attribute ;
244245 $ original = $ original instanceof UTCDateTime ? $ this ->asDateTime ($ original ) : $ original ;
245246
246- return $ current == $ original ;
247+ return $ attribute == $ original ;
247248 }
248249
249- if ($ this ->hasCast ($ key )) {
250- return $ this ->castAttribute ($ key , $ current ) ===
250+ if ($ this ->hasCast ($ key, static :: $ primitiveCastTypes )) {
251+ return $ this ->castAttribute ($ key , $ attribute ) ===
251252 $ this ->castAttribute ($ key , $ original );
252253 }
253254
254- return is_numeric ($ current ) && is_numeric ($ original )
255- && strcmp ((string ) $ current , (string ) $ original ) === 0 ;
255+ return is_numeric ($ attribute ) && is_numeric ($ original )
256+ && strcmp ((string ) $ attribute , (string ) $ original ) === 0 ;
256257 }
257258
258259 /**
0 commit comments