2021-06-29 00:27:57 +02:00
|
|
|
<?php
|
|
|
|
|
2023-02-03 20:41:59 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2021-06-29 00:27:57 +02:00
|
|
|
namespace Database\Factories\Engelsystem\Models\User;
|
|
|
|
|
|
|
|
use Engelsystem\Models\User\User;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
|
|
|
|
class UserFactory extends Factory
|
|
|
|
{
|
|
|
|
/** @var string */
|
2022-12-15 19:50:56 +01:00
|
|
|
protected $model = User::class; // phpcs:ignore
|
2021-06-29 00:27:57 +02:00
|
|
|
|
2022-12-14 19:15:20 +01:00
|
|
|
public function definition(): array
|
2021-06-29 00:27:57 +02:00
|
|
|
{
|
|
|
|
return [
|
|
|
|
'name' => $this->faker->unique()->userName(),
|
2022-12-13 19:00:43 +01:00
|
|
|
'password' => crypt(random_bytes(16), '$1$salt$'),
|
2021-06-29 00:27:57 +02:00
|
|
|
'email' => $this->faker->unique()->safeEmail(),
|
2022-12-08 15:57:13 +01:00
|
|
|
'api_key' => bin2hex(random_bytes(32)),
|
2021-06-29 00:27:57 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|