owen-it / laravel-auditing

Record the change log from models in Laravel
https://laravel-auditing.com
MIT License
3.05k stars 390 forks source link

Include Attribute Mutator on Audit Formatting #829

Closed hamedghaderi closed 1 year ago

hamedghaderi commented 1 year ago

Issue

This pull request addresses the issue of the Audit functionality in the Laravel framework failing to include attribute accessors during the formatting process.

Solution

To solve this issue, I have made modifications to the Audit functionality. The changes now include attribute accessors when formatting the data. This ensures that any custom formatting defined through attribute accessors is properly considered.

Related Issue #828

Checklist

anteriovieira commented 1 year ago

After we have tests and doc I can merge it. Would someone be able to help us?

hamedghaderi commented 1 year ago

@anteriovieira The change aligns with standard Laravel behavior, so there's no need for documentation updates. While it may seem like a new feature, it's essentially a bug-fix for Laravel's attribute mutators.

MortenDHansen commented 1 year ago

Thanks @hamedghaderi. We do however run into an issue. The named parameters in the new laravel style would only work from PHP 8.0 and v13 support 7.4

On v8.0 and upo, the test fails, but i haven't looked into why yet