Hi there,
In my user registration page, I need to create a user and on creation assign it some values to some fields.
In my registration controller, this works:
$user = $kirby->users()->create([
'email' => $email,
'password' => $password,
'role' => 'exhibitor',
'language' => 'en',
'name' => $name
]);
$user->update([
'exhibitor' => $exhibitor,
'isVerified' => false,
'token' => $token
]);
But this shorter, more elegant version, inspired by the docs, doesn’t:
$kirby->users()->create([
'email' => $email,
'password' => $password,
'role' => 'exhibitor',
'language' => 'en',
'name' => $name,
'content' => [
'exhibitor' => $exhibitor,
'isVerified' => false,
'token' => $token
]
]);
Why?
No big deal if that’s the only way it can be done, but would like to at least understand the reason for this.