@@ -222,7 +222,7 @@ public function getTable()
222222 public function getAttribute ($ key )
223223 {
224224 // Check if the key is an array dot notation.
225- if (strpos ($ key , '. ' ) !== false )
225+ if (str_contains ($ key , '. ' ))
226226 {
227227 $ attributes = array_dot ($ this ->attributes );
228228
@@ -274,7 +274,7 @@ protected function getAttributeFromArray($key)
274274 return $ this ->attributes [$ key ];
275275 }
276276
277- else if ( strpos ($ key , '. ' ) !== false )
277+ elseif ( str_contains ($ key , '. ' ))
278278 {
279279 $ attributes = array_dot ($ this ->attributes );
280280
@@ -302,6 +302,17 @@ public function setAttribute($key, $value)
302302 $ value = $ builder ->convertKey ($ value );
303303 }
304304
305+ // Support keys in dot notation.
306+ elseif (str_contains ($ key , '. ' ))
307+ {
308+ if (in_array ($ key , $ this ->getDates ()) && $ value )
309+ {
310+ $ value = $ this ->fromDateTime ($ value );
311+ }
312+
313+ array_set ($ this ->attributes , $ key , $ value ); return ;
314+ }
315+
305316 parent ::setAttribute ($ key , $ value );
306317 }
307318
0 commit comments