Reference

User::create()

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

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

Parameters

Name Type Default Description
$props array null

Return type

Kirby\Cms\User

The $props parameter

Property Type
email string
name string
password string
role string
language string
content array

Example

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

Source code

kirby/src/Cms/UserActions.php#L159