Skip to content

Commit

Permalink
2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
chr15k committed Nov 29, 2024
1 parent 0f3c2a4 commit d64e937
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.1.1 - 2024-11-29

- Remove call to global helper

## 2.1.0 - 2024-11-29

- Minor refactor
Expand Down
3 changes: 2 additions & 1 deletion src/Scopes/DecryptSelectScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Chr15k\MysqlEncrypt\Scopes;

use Chr15k\MysqlEncrypt\MysqlEncrypt;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Scope;
Expand All @@ -21,7 +22,7 @@ public function apply(Builder $builder, Model $model): Builder
}

return $builder->addSelect(...collect($columns)->map(
fn ($column) => (in_array($column, $encryptable)) ? db_decrypt($column) : $column
fn ($column) => (in_array($column, $encryptable)) ? MysqlEncrypt::decrypt($column) : $column
));
}
}

0 comments on commit d64e937

Please sign in to comment.