Confirm the right behavior of user with deleted_at value #1073
-
I created an activate/deactivate functionality for users. I used the soft delete functionality for deactivation. However, when I try to activate the user, it's not shown when called in |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
What did you created?
What do you mean? If you use CI4 Model's soft delete feature, it deletes records logically. |
Beta Was this translation helpful? Give feedback.
What did you created?
What do you mean?
If you use CI4 Model's soft delete feature, it deletes records logically.
If a record has
deleted_at
datetime, the record is treated as deleted.So
$users->findById([user_id])
returns null.See https://codeigniter4.github.io/CodeIgniter4/models/model.html#usesoftdeletes