Skip to content

Commit

Permalink
Adding example for maskSensitiveData
Browse files Browse the repository at this point in the history
  • Loading branch information
spekulatius committed Apr 10, 2023
1 parent 4045f8b commit c934799
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Expand Up @@ -11,7 +11,17 @@ This is a personal collection of handy helpers, tools, and utilities that I've u

### `maskSensitiveData`: Collection Makro to mask sensitive data

`maskSensitiveData` Laravel Collection macro and provides the functionality to mask sensitive data in a collection. The macro prepares masked fields regular expressions for use, and applies the mask to the sensitive data based on the regexes and custom fields. It maps over the collection and replaces any data matching the regular expressions with a mask value of [masked]. This functionality is useful when dealing with collections of sensitive data and is designed to keep the sensitive data secure.
`maskSensitiveData` Laravel Collection macro and provides the functionality to mask sensitive data in a collection. The macro prepares masked fields regular expressions for use, and applies the mask to the sensitive data based on the regexes and custom fields. It maps over the collection and replaces any data matching the regular expressions with a mask value of `[masked]`. This functionality is useful when dealing with collections of sensitive data and is designed to keep the sensitive data secure.

Usage:

```php
collect(['password' => 'this really should not be logged...'])
->maskSensitiveData()
->toArray();

// 'password' => '[masked]'
```

### `ToLog`: Model Trait to log context

Expand Down

0 comments on commit c934799

Please sign in to comment.