refactor: revamp the user seeder

This commit is contained in:
2022-09-01 16:03:23 +01:00
parent c793596a3a
commit 43e6859366
12 changed files with 96 additions and 130 deletions

View File

@@ -3,6 +3,7 @@
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\User>
@@ -17,7 +18,19 @@ class UserFactory extends Factory
public function definition()
{
return [
//
'uuid' => $this->faker->uuid(),
'name' => $this->faker->name(),
'email' => $this->faker->unique()->safeEmail(),
'email_verified_at' => Carbon::now(),
'username' => $this->faker->userName(),
'dob' => Carbon::now(),
'password' => bcrypt($this->faker->password),
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
'password_last_updated' => Carbon::now(),
'administratively_locked' => false,
'registrationIp' => $this->faker->ipv4(),
'currentIp' => $this->faker->ipv4(),
];
}
}