Attribute modifiers for array-casted fields #796
-
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' => 'alice@example.com',
'password' => 'Pa$$w0rd',
] After modifications:[
'email' => 'alice@example.com',
'password' => 'Pa******',
] |
Beta Was this translation helpful? Give feedback.
Answered by
parallels999
Mar 13, 2023
Replies: 1 comment
-
Seems not possible because it only has attributes names, you could use laravel-auditing/src/Auditable.php Lines 346 to 349 in 5f86086 Also you could make a PR for adding that feature |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
parallels999
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Seems not possible because it only has attributes names, you could use
transformAudit($data)
for changing thatlaravel-auditing/src/Auditable.php
Lines 346 to 349 in 5f86086
Also you could make a PR for adding that feature