engelsystem/db/factories/User/UserFactory.php

26 lines
692 B
PHP
Raw Normal View History

2021-06-29 00:27:57 +02:00
<?php
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 */
protected $model = User::class; // phpcs:ignore
2021-06-29 00:27:57 +02:00
public function definition(): array
2021-06-29 00:27:57 +02:00
{
return [
'name' => $this->faker->unique()->userName(),
'password' => crypt(random_bytes(16), '$1$salt$'),
2021-06-29 00:27:57 +02:00
'email' => $this->faker->unique()->safeEmail(),
'api_key' => bin2hex(random_bytes(32)),
'updated_at' => $this->faker->dateTimeInInterval('-3 months', 'now'),
2021-06-29 00:27:57 +02:00
];
}
}