laravel-auditing
laravel-auditing copied to clipboard
Attribute modifiers for array-casted fields
| Q | A |
|---|---|
| Bug? | no |
| New Feature? | yes |
| Framework | Laravel |
| Framework version | 7.29.0 |
| Package version | 11.0.0 |
| PHP version | 7.4.10 |
It will be very handy to have attribute modifiers for fields casted to array.
Example:
protected $casts = [
'credentials' => 'array', // jsonb
];
protected $attributeModifiers = [
'credentials.password' => RightRedactor::class,
];
Before modifications:
[
'email' => '[email protected]',
'password' => 'Pa$$w0rd',
]
After modifications:
[
'email' => '[email protected]',
'password' => 'Pa******',
]