How to fill other columns of a user table when creating a new user #461
-
|
From the quickstart docs, we have this example: But I see that there are other vital columns like But none of the the fields: What is the best way to include any of these columns to the list of user information to create or edit using the same format explained in the docs? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
|
With the special exception of the credentials (which "pass through" to the identities table) protected $allowedFields = [
'username',
'status',
'status_message',
'active',
'last_active',
'deleted_at',
];For modifying identities you can use the model directly: https://github.com/codeigniter4/shield/blob/develop/src/Models/UserIdentityModel.php |
Beta Was this translation helpful? Give feedback.
-
|
You need to extend UserModel and use it.
|
Beta Was this translation helpful? Give feedback.
You need to extend UserModel and use it.
userstable, add the columns toUserModel::$allowedFields.auth_identitiestable, you need to call UserIdentityModel::save() after calling$users->save().