Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -2586,7 +2586,7 @@ public function escapeWhenCastingToString($escape = true)
*
* @return array
*/
public function __sleep()
public function __serialize()
{
$this->mergeAttributesFromCachedCasts();

Expand All @@ -2595,7 +2595,7 @@ public function __sleep()
$this->relationAutoloadCallback = null;
$this->relationAutoloadContext = null;

return array_keys(get_object_vars($this));
return get_object_vars($this);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Queue/Middleware/RateLimited.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ protected function getTimeUntilNextRetry($key)
*
* @return array
*/
public function __sleep()
public function __serialize()
{
return [
'limiterName',
'shouldRelease',
'limiterName' => $this->limiterName,
'shouldRelease' => $this->shouldRelease,
];
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Cache/Fixtures/Unserializable.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class Unserializable
{
public function __sleep()
public function __serialize()
{
throw new Exception('Not serializable');
}
Expand Down