unsa-pis-be/database/factories/UserFactory.php

42 lines
930 B
PHP
Raw Permalink Normal View History

2022-06-14 01:21:39 +00:00
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
*/
class UserFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition()
{
return [
2022-08-02 04:44:21 +00:00
'name' => $this->faker->name(),
'lastname' => $this->faker->lastname(),
2022-06-14 01:21:39 +00:00
'email' => $this->faker->unique()->safeEmail(),
2022-08-02 04:44:21 +00:00
'password' => $this, // password
2022-06-14 01:21:39 +00:00
];
}
/**
* Indicate that the model's email address should be unverified.
*
* @return static
*/
public function unverified()
{
return $this->state(function (array $attributes) {
return [
'email_verified_at' => null,
];
});
}
}