Generate a more unique username

This commit is contained in:
DaneEveritt 2022-06-26 16:37:43 -04:00
parent 43156e8d53
commit 3f2bd78563
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -27,7 +27,7 @@ class UserFactory extends Factory
return [ return [
'external_id' => null, 'external_id' => null,
'uuid' => Uuid::uuid4()->toString(), 'uuid' => Uuid::uuid4()->toString(),
'username' => $this->faker->unique()->userName, 'username' => $this->faker->userName . '_' . Str::random(10),
'email' => Str::random(32) . '@example.com', 'email' => Str::random(32) . '@example.com',
'name_first' => $this->faker->firstName, 'name_first' => $this->faker->firstName,
'name_last' => $this->faker->lastName, 'name_last' => $this->faker->lastName,
@ -45,10 +45,6 @@ class UserFactory extends Factory
*/ */
public function admin(): Factory public function admin(): Factory
{ {
return $this->state(function (array $attributes) { return $this->state(['root_admin' => true]);
return [
'root_admin' => true,
];
});
} }
} }