23 lines
539 B
PHP
23 lines
539 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Facades\Hash;
|
|
|
|
class UserFactory extends Factory
|
|
{
|
|
protected static ?string $password;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'email' => fake()->unique()->safeEmail(),
|
|
'username' => fake()->unique()->userName(),
|
|
'password' => static::$password ??= Hash::make('password'),
|
|
'is_active' => true,
|
|
'last_login_at' => null,
|
|
];
|
|
}
|
|
}
|