File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/Jenssegers/Mongodb/Eloquent Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -237,7 +237,12 @@ public function getAttribute($key)
237
237
*/
238
238
protected function getAttributeFromArray ($ key )
239
239
{
240
- return array_get ($ this ->attributes , $ key );
240
+ // Support keys in dot notation.
241
+ if (str_contains ($ key , '. ' )) {
242
+ return array_get ($ this ->attributes , $ key );
243
+ }
244
+
245
+ return parent ::getAttributeFromArray ($ key );
241
246
}
242
247
243
248
/**
@@ -253,9 +258,7 @@ public function setAttribute($key, $value)
253
258
$ builder = $ this ->newBaseQueryBuilder ();
254
259
255
260
$ value = $ builder ->convertKey ($ value );
256
- }
257
-
258
- // Support keys in dot notation.
261
+ } // Support keys in dot notation.
259
262
elseif (str_contains ($ key , '. ' )) {
260
263
if (in_array ($ key , $ this ->getDates ()) && $ value ) {
261
264
$ value = $ this ->fromDateTime ($ value );
You can’t perform that action at this time.
0 commit comments