Usermanager/Database/factories/UserFactory.php

41 lines
1.2 KiB
PHP
Raw Normal View History

2023-05-20 14:10:32 +00:00
<?php
2023-05-21 05:37:35 +00:00
namespace Modules\Usermanager\Database\factories;
2023-05-20 14:10:32 +00:00
2023-05-21 05:37:35 +00:00
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
2023-05-20 14:10:32 +00:00
/**
2023-05-21 05:37:35 +00:00
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\Modules\Usermanager\Entities\User>
2023-05-20 14:10:32 +00:00
*/
2023-05-21 05:37:35 +00:00
class UserFactory extends Factory
2023-05-20 14:10:32 +00:00
{
2023-05-21 05:37:35 +00:00
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition()
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
}
2023-05-20 14:10:32 +00:00
2023-05-21 05:37:35 +00:00
/**
* Indicate that the model's email address should be unverified.
*
* @return static
*/
public function unverified()
{
return $this->state(fn(array $attributes) => [
'email_verified_at' => null,
]);
}
2023-05-20 14:10:32 +00:00
}