You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ If you have never used the Composer dependency manager before, head to the [Comp
17
17
To redact fields simply extend `RedactedModel` in your model and set the `redacted` variable to an array of the fields you want to protect. By default when accesed these fields will return `[Hidden Data]`.
18
18
19
19
```php
20
-
class SensetiveModel extends RedactedModel
20
+
class SensitiveModel extends RedactedModel
21
21
{
22
22
protected $redacted = ['name'];
23
23
}
@@ -30,13 +30,13 @@ To conditionally redact fields override `shouldRedactField` on your model. The n
30
30
_Note: Only fields specified in `$redacted` will be redacted regardless of what's returned from this method._
31
31
32
32
```php
33
-
class SensetiveModel extends RedactedModel
33
+
class SensitiveModel extends RedactedModel
34
34
{
35
35
protected $redacted = ['name'];
36
36
37
37
public function shouldRedactField($key)
38
38
{
39
-
return !\Auth::user()->canSeeSensetiveFields();
39
+
return !\Auth::user()->canSeeSensitiveFields();
40
40
}
41
41
}
42
42
```
@@ -47,7 +47,7 @@ class SensetiveModel extends RedactedModel
47
47
To change the message returned you can set the `redactedString` on your model. This will then be returned instead of `[Hidden Data]`.
48
48
49
49
```php
50
-
class SensetiveModel extends RedactedModel
50
+
class SensitiveModel extends RedactedModel
51
51
{
52
52
protected $redacted = ['name'];
53
53
@@ -60,18 +60,18 @@ class SensetiveModel extends RedactedModel
60
60
If you want to completely omit the field instead of redacting it you can set the `redact` variable on your model to false.
61
61
62
62
```php
63
-
class SensetiveModel extends RedactedModel
63
+
class SensitiveModel extends RedactedModel
64
64
{
65
65
protected $redacted = ['name'];
66
66
67
67
protected $redact = false;
68
68
}
69
69
```
70
70
71
-
By default the array key of fields that return `null` and are in the redacted fields list will too be omitted in case the field name is sensetive. To disable this set `$redactKeys` to false on your model.
71
+
By default the array key of fields that return `null` and are in the redacted fields list will too be omitted in case the field name is Sensitive. To disable this set `$redactKeys` to false on your model.
72
72
73
73
```php
74
-
class SensetiveModel extends RedactedModel
74
+
class SensitiveModel extends RedactedModel
75
75
{
76
76
protected $redacted = ['name'];
77
77
@@ -86,7 +86,7 @@ Redacted value accessors are defined the same way as [Laravel Accessors](https:/
86
86
The original value is passed into the method, this allows you to abstract the value instead of omitting or redacting it.
0 commit comments