UserFactory

Statamic\Data\Users\UserFactory


Usage

Create a UserFactory using the API class.

$factory = Statamic\API\User::create();

Available Methods

with

Add an array of data to the object. “Create an object with this data.”

$factory->with(['foo' => 'bar', 'baz' => 'qux']);

username

Specify the username.

$factory->username('ron');

email

Specify the email address. This is an alias for passing the email in with data.

$factory->email('ron@swanson.com');

Import using:

use Statamic\Data\Users\UserFactory