Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Attribute Mutator on Audit Formatting #829

Merged
merged 4 commits into from
Oct 10, 2023

Conversation

hamedghaderi
Copy link
Contributor

@hamedghaderi hamedghaderi commented May 16, 2023

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

  • Tests have been added to cover the changes.
  • Documentation has been updated to reflect the changes.

@anteriovieira
Copy link
Member

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

@anteriovieira anteriovieira added the help wanted Assistance or contributions needed label Jun 19, 2023
- Extended the itResolvesAuditData, itResolvesAuditDataIncludingUserAttributes, itReturnsTheAppropriateAuditableDataValues, itReturnsAuditableModifiedAttributesAsArray, itReturnsAuditableModifiedAttributesAsJsonString, to validate the behavior of attribute mutator.
- Add content mutator in Article model
@hamedghaderi
Copy link
Contributor Author

@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
Copy link
Contributor

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

@MortenDHansen MortenDHansen merged commit a8de033 into owen-it:master Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Assistance or contributions needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants