extjac said:
i use created_by, updated_by and deleted_by too
do you use the user ID or user name?
dont use username or user_id. There are many ways you can do this...Simple or Complex....but I would not use useranme for sure
i think it depends.. if you ALLOW your user to change their username then don't use them.. but even if you do ID (number) is a better strategy.. to avoid code error in terms of querying data.. performance might be better with ID too (not verified).
Yes my problem would be that the name could change, e.g if somebody gets married.
@extjac so what solution do you use?
When you're making a reference like this, you want to use a data-point that is non-volatile as a reference.
In most situations, I don't care what the username of the person who made the change was as much as I care what person it actually was. So I would use user_id as the reference. Further, you can combine it with soft-deletes on the Users model so that even if a user has been deleted, you still have records of the changes they had made.
It can help but for me i am looking for software that can give backup as for now and with backup and recovery software also, My friends recommended me of "Ahsay software" they say they are using it for Business use only so "Ahsay software" is in my list but need more recommendations.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community