Skip to content

Kirby 5.0.4

User::create()

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

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

Parameters

Name Type Default
$propsrequired array no default value

Return type

Kirby\Cms\User

Parent class

Kirby\Cms\User

Examples

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