Foreign key references to User
table
#103
-
Hi @neonexus I have a table (says If I reference the attribute I am thinking to use the Do you have any other better suggestions regarding this? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@MaheshkumarSundaram This is why it is best practice to never delete a user record, but instead, use soft-deletes, like I do in the user model. I have a Essentially, the idea is, if even you recreate the user, you can still use the deleted user as a pointer, not just to the user, but that user in time. |
Beta Was this translation helpful? Give feedback.
@MaheshkumarSundaram This is why it is best practice to never delete a user record, but instead, use soft-deletes, like I do in the user model. I have a
deletedAt
(anddeletedBy
) which I use in the login controller; but now that I look at it, needs to be added to theisLoggedIn
policy... So I have a new update coming soon...Essentially, the idea is, if even you recreate the user, you can still use the deleted user as a pointer, not just to the user, but that user in time.