Skip to content

Commit

Permalink
fix: allow null values (#2)
Browse files Browse the repository at this point in the history
Fixed payload error when model property is empty
  • Loading branch information
sagalbot authored May 3, 2020
2 parents 7517070 + 9e9d3d1 commit dc302db
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Encryptable.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public function encryptable($key)
*/
protected function decryptAttribute($value)
{
$value = decrypt($value);
if ($value) {
$value = decrypt($value);
}

return $value;
}
Expand All @@ -55,7 +57,9 @@ protected function decryptAttribute($value)
*/
protected function encryptAttribute($value)
{
$value = encrypt($value);
if ($value) {
$value = encrypt($value);
}

return $value;
}
Expand Down

0 comments on commit dc302db

Please sign in to comment.