TappNetwork / filament-auditing

A Filament plugin for Laravel Auditing package.
81 stars 20 forks source link

Key/Value column view supports attach / detach #9

Closed aSeriousDeveloper closed 1 year ago

aSeriousDeveloper commented 1 year ago

Laravel Auditing 13 allows for tracking related (many/many) changes in Audit History: https://laravel-auditing.com/guide/audit-custom.html#example-related-attributes

Part of this changes includes attaching and detaching these relationships, which causes the old_values column to contain a nested array. However, the default Key/Value view doesn't support a nested array like this and throws a TypeError of: htmlspecialchars(): Argument #1 ($string) must be of type string, array given

The included change is a quick fix that checks to see if there is indeed a nested array and if so displays the list of attached/detached IDs. I've also included some classes for minor Dark Mode support.

what-the-diff[bot] commented 1 year ago

PR Summary

andreia commented 1 year ago

That's great, thank you @aSeriousDeveloper !