Ability to display foreign ids as a field from the related table #32
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
php
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pxlrbt/filament-activity-log#32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Foreign IDs are display as an ID. Ideally we'd be able to specify how these fields are displayed using data from the related table:
Hi, i was having the same issue with you, especially displaying BelongsTo relationship. After reading in spatie/activitty-log package, there is a way to solve this using dot notation, for example
Read more about that in this Link
However, using the dot notation causes issue with this package, because this package uses the get_data helper where it will break array structure using the dot notation as well.
Therefore currently I am implementing a custom pipe in spatie activity log using LoggablePipe (read more about it here) to replace all dot notation in the changes with underscore instead. This is what I did:
Now you can log any relationship using dot notation without breaking this package. I hope later on the owner of this package can see this solution and comeup with a more permanent solution built into the next version
Because using the dot notation is a standard method in the spatie package which this package relies on
Tagging @pxlrbt
Thank You
Works well, thank you. The only place where it doesn't work is on belongsToMany methods but looks like this package doesn't store changes to these at all anyway so I will need to have a think about how to log those kind of changes.