Closed ludgerey closed 3 years ago
Hey @ludgerey I think the idea of using the title is a good idea and would be open to adding that feature at some point. In the meantime, if you do not use the name
attribute in your User model, you can create a dynamic name attribute using a model accessor ( See defining an accessor: https://laravel.com/docs/6.x/eloquent-mutators#defining-an-accessor).
In addition to this, I would recommend adding that attribute to the appends array of your User model as well, so that it is added to the JSON output (See appending values to JSON: https://laravel.com/docs/6.x/eloquent-serialization#appending-values-to-json).
I hope this helps!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'm going actually close this issue since the name field is pretty common and the accessor method should work for the majority of cases that don't use a "name" field.
The user is not shown in the Audit Log UI. I assume it's because I don't have the default
name
field on the user. I am usinggiven_name
andfamily_name
. Is there a way to render the user name in that audit log?The corresponding HTTP response:
I think the perfect solution would be a rendering like Nova does in the usual data grids: Using the Nova Resource for
title()
and a link to the corresponding record.