From 3f2bd78563cba451e0faa1b8d4c93c67e29d2036 Mon Sep 17 00:00:00 2001 From: DaneEveritt Date: Sun, 26 Jun 2022 16:37:43 -0400 Subject: [PATCH] Generate a more unique username --- database/Factories/UserFactory.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/database/Factories/UserFactory.php b/database/Factories/UserFactory.php index cabfed7be..1e38eced6 100644 --- a/database/Factories/UserFactory.php +++ b/database/Factories/UserFactory.php @@ -27,7 +27,7 @@ class UserFactory extends Factory return [ 'external_id' => null, 'uuid' => Uuid::uuid4()->toString(), - 'username' => $this->faker->unique()->userName, + 'username' => $this->faker->userName . '_' . Str::random(10), 'email' => Str::random(32) . '@example.com', 'name_first' => $this->faker->firstName, 'name_last' => $this->faker->lastName, @@ -45,10 +45,6 @@ class UserFactory extends Factory */ public function admin(): Factory { - return $this->state(function (array $attributes) { - return [ - 'root_admin' => true, - ]; - }); + return $this->state(['root_admin' => true]); } }