Skip to content

Kirby 3.8.4

Users::factory()

Takes an array of user props and creates a nice and clean user collection from it

Users::factory(array $users, array $inject = [ ]): Kirby\Cms\Users

Parameters

Name Type Default
$users * array
$inject array [ ]

The $users parameter is an array of Kirby\Cms\User objects or an array of arrays, where each array contains the properties to create a Kirby\Cms\User object. Pass the following data for each user:

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

Kirby\Cms\Users

Parent class

Kirby\Cms\Users