diff --git a/src/Illuminate/Database/Eloquent/Casts/AsEncryptedArrayObject.php b/src/Illuminate/Database/Eloquent/Casts/AsEncryptedArrayObject.php index 68273a5e5240..cd65624650ec 100644 --- a/src/Illuminate/Database/Eloquent/Casts/AsEncryptedArrayObject.php +++ b/src/Illuminate/Database/Eloquent/Casts/AsEncryptedArrayObject.php @@ -29,7 +29,7 @@ public function get($model, $key, $value, $attributes) public function set($model, $key, $value, $attributes) { - if ($value !== null) { + if (! is_null($value)) { return [$key => Crypt::encryptString(json_encode($value))]; } @@ -38,7 +38,7 @@ public function set($model, $key, $value, $attributes) public function serialize($model, string $key, $value, array $attributes) { - return $value !== null ? $value->getArrayCopy() : null; + return ! is_null($value) ? $value->getArrayCopy() : null; } }; } diff --git a/src/Illuminate/Database/Eloquent/Casts/AsEncryptedCollection.php b/src/Illuminate/Database/Eloquent/Casts/AsEncryptedCollection.php index 0021861e1254..4d9fee7ece85 100644 --- a/src/Illuminate/Database/Eloquent/Casts/AsEncryptedCollection.php +++ b/src/Illuminate/Database/Eloquent/Casts/AsEncryptedCollection.php @@ -30,7 +30,7 @@ public function get($model, $key, $value, $attributes) public function set($model, $key, $value, $attributes) { - if ($value !== null) { + if (! is_null($value)) { return [$key => Crypt::encryptString(json_encode($value))]; }