We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97de613 commit 8ee9a68Copy full SHA for 8ee9a68
src/Eloquent/Model.php
@@ -209,15 +209,15 @@ protected function getAttributeFromArray($key)
209
/** @inheritdoc */
210
public function setAttribute($key, $value)
211
{
212
+ $key = (string) $key;
213
+
214
// Convert _id to ObjectID.
215
if ($key === '_id' && is_string($value)) {
216
$builder = $this->newBaseQueryBuilder();
217
218
$value = $builder->convertKey($value);
219
}
220
- $key = (string) $key;
-
221
// Support keys in dot notation.
222
if (str_contains($key, '.')) {
223
// Store to a temporary key, then move data to the actual key
0 commit comments