-
Notifications
You must be signed in to change notification settings - Fork 399
Open
Description
Q | A |
---|---|
Bug? | yes |
New Feature? | no |
Framework | Laravel |
Framework version | 10.8.0 |
Package version | 13.5.0 |
PHP version | 8.2 |
Actual Behaviour
Currently, when the Audit functionality formats data, it fails to detect and include attribute accessors of type "Attribute" during the formatting process. As a result, attribute accessors are not considered when formatting the data.
Expected Behaviour
It is expected that the Audit functionality should include attribute accessors of type "Attribute" during the data formatting process. This would ensure that any custom formatting defined through attribute accessors is properly considered.
Steps to Reproduce
- Assume we have a model
Foo
with a JSON attribute,bar
, casted as anArrayObject
:
class Foo extends Model implements Auditable
{
protected $casts = [
'bar' => AsArrayObject::class,
];
}
- Before fetching the bar attribute, we add custom formatting using an attribute accessor:
public function bar(): Attribute
{
return Attribute::make(
get: fn ($value) => // Some custom formatting
)
}
- The Audit functionality currently ignores this custom formatting because it only checks for attribute accessors starting with get, such as getBarAttribute.

Metadata
Metadata
Assignees
Labels
No labels