38 lines
928 B
PHP
38 lines
928 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Database\Factories;
|
||
|
|
|
||
|
|
use App\Enums\AppUserRolesEnum;
|
||
|
|
use App\Models\AppUser;
|
||
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @extends Factory<\App\Models\AppUser>
|
||
|
|
*/
|
||
|
|
class AppUserFactory extends Factory
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* The name of the factory's corresponding model.
|
||
|
|
*
|
||
|
|
* @var string
|
||
|
|
*/
|
||
|
|
protected $model = AppUser::class;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Define the model's default state.
|
||
|
|
*
|
||
|
|
* @return array
|
||
|
|
*/
|
||
|
|
public function definition()
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'firstname' => $this->faker->unique()->firstname(),
|
||
|
|
'lastname' => $this->faker->unique()->lastName(),
|
||
|
|
'email' => $this->faker->unique()->safeEmail(),
|
||
|
|
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',
|
||
|
|
'status' => $this->faker->boolean(75),
|
||
|
|
'role' => collect(AppUserRolesEnum::toArray())->random(),
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|