pxlrbt / filament-activity-log

Spatie activity log integration into Filament
MIT License
126 stars 24 forks source link

return empty array #4

Closed cntabana closed 1 year ago

cntabana commented 1 year ago

This pull request addresses an important issue related to null attributes ;l;.

Previously, when data_get($changes, 'attributes') returned null, it would result in a 500 error. To mitigate this issue, this pull request introduces a fix that returns an empty array when the attributes are null. This prevents the occurrence of errors and ensures smooth functionality.

For example, when using the softDeletes feature, if you attempt to retrieve information about the entity that was soft-deleted and the attributes are null, you would previously encounter an error message. However, with this fix in place, the code gracefully handles the null attributes and returns an empty array instead, preventing any disruptive errors.

Please review the changes made in this pull request and provide any feedback or suggestions. Your input is greatly appreciated. Thank you!

pxlrbt commented 1 year ago

Thanks for your PR.