I have a column that show the date in which an user update a record.
It’s all ok. Now, I need to show, near the date, the name of the user that have update the record.
For example: 2020-06-12 10:05:36 from Michael
I have to change the value of the attribute? The implementation is this:
Hi, you just need to add an attribute which stores username who updated your record. For example if you have database column/model attribute which stores editor’s username named updated_by, change the returned value as shown below.
That is simply getting the current user’s name. It is in no way tied to the record and/or who actually performed the last update.
As kubove indicated, you need to add a new attribute to your table and store the userid value when changes are made. You could code it in your controller action or perhaps use a beforeSave() function within your model to automatically populate it.