Skip to content

Commit

Permalink
Merge pull request #2 from s3rajkarnikar/master
Browse files Browse the repository at this point in the history
Accounting for already encrypted values when using update method
  • Loading branch information
darrentaytay committed Sep 8, 2015
2 parents cf1f790 + 23324fd commit 01dd31e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Dtisgodsson/Elocrypt/ElocryptTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ public function update(Array $attributes = [])
{
try
{
$attributes[$key] = Crypt::encrypt($value);
$decrypted = Crypt::decrypt($value);
$attributes[$key] = $value;
}
catch(DecryptException $exception)
{
$attributes[$key] = $value;
$attributes[$key] = Crypt::encrypt($value);
}
}
}
Expand Down

0 comments on commit 01dd31e

Please sign in to comment.