diff --git a/src/Illuminate/Queue/SerializesModels.php b/src/Illuminate/Queue/SerializesModels.php index 62f7e7218e9a..15c4af3c4918 100644 --- a/src/Illuminate/Queue/SerializesModels.php +++ b/src/Illuminate/Queue/SerializesModels.php @@ -24,9 +24,9 @@ public function __sleep() )); } - return array_map(function ($p) { - return $p->getName(); - }, $properties); + return array_filter(array_map(function ($p) { + return $p->isStatic() ? null : $p->getName(); + }, $properties)); } /** @@ -37,6 +37,10 @@ public function __sleep() public function __wakeup() { foreach ((new ReflectionClass($this))->getProperties() as $property) { + if ($property->isStatic()) { + continue; + } + $property->setValue($this, $this->getRestoredPropertyValue( $this->getPropertyValue($property) ));