<?php

namespace Database\Factories;

use App\Enums\UserStatus;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;

class UserFactory extends Factory
{
    public function definition(): array
    {
        return [
            'email' => $this->faker->unique()->safeEmail(),
            'username' => fake()->unique()->regexify('[A-Za-z0-9]{8}'),
            'password' => Hash::make(config('myconfig.password_default')),
            'status' => $this->faker->randomElement(UserStatus::cases()),
        ];
    }
}
