Skip to content


Creates a new User from the given props and returns a new User object

User::create(array $props = null): Kirby\Cms\User


Name Type Default
$props array null

For the $props parameter, you pass an array with the following data, which will be used to set up the Kirby\Cms\User object:

Name Type Description
blueprint array Sets the Blueprint object
content array Sets the Content object
email string Sets the user email
files array Sets the Files collection
id string Sets the user id
language string Sets the user language
name string Sets the user name
password string Sets the user's password hash
role string Sets the user role
translations array Create the translations collection from an array

Return type


Parent class



$newUser = User::create([
  'email'     => '',
  'name'      => 'Bastian',
  'role'      => 'admin',
  'language'  => 'en',
  'password'  => 'topSecret',
  'content'   => [
    'twitter'   => '@getkirby',
    'position'  => 'founder'