diff --git a/src/Illuminate/Queue/SerializesModels.php b/src/Illuminate/Queue/SerializesModels.php index d60479d20708..575dbadf040b 100644 --- a/src/Illuminate/Queue/SerializesModels.php +++ b/src/Illuminate/Queue/SerializesModels.php @@ -71,6 +71,12 @@ public function __serialize() continue; } + $value = $this->getPropertyValue($property); + + if ($property->hasDefaultValue() && $value === $property->getDefaultValue()) { + continue; + } + $name = $property->getName(); if ($property->isPrivate()) { @@ -79,9 +85,7 @@ public function __serialize() $name = "\0*\0{$name}"; } - $values[$name] = $this->getSerializedPropertyValue( - $this->getPropertyValue($property) - ); + $values[$name] = $this->getSerializedPropertyValue($value); } return $values;