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 9c80cf4 commit 67fbb51Copy full SHA for 67fbb51
src/Illuminate/Database/Eloquent/Model.php
@@ -2421,15 +2421,7 @@ public function __sleep()
2421
$this->classCastCache = [];
2422
$this->attributeCastCache = [];
2423
2424
- // When serializing the model, we may accidentally catch up some virtual properties.
2425
- // We will cast the model to a native array to skip them and then apply a function
2426
- // to clean each of the property names which is miles faster than using a regex.
2427
- return array_map(
2428
- fn ($key) => $key[0] === "\0"
2429
- ? substr($key, strpos($key, "\0", 1) + 1)
2430
- : $key,
2431
- array_keys((array) $this)
2432
- );
+ return array_keys(get_object_vars($this));
2433
}
2434
2435
/**
0 commit comments