2015-05-08 08:42:04 -05:00
|
|
|
<?php
|
|
|
|
|
2020-04-21 10:12:39 -05:00
|
|
|
namespace Database\Factories;
|
2019-12-31 12:21:39 +00:00
|
|
|
|
2020-08-20 15:31:07 -05:00
|
|
|
use App\Models\User;
|
2020-04-21 10:12:39 -05:00
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
2019-09-10 17:26:00 +02:00
|
|
|
use Illuminate\Support\Str;
|
2017-04-11 10:41:19 -05:00
|
|
|
|
2020-04-21 10:12:39 -05:00
|
|
|
class UserFactory extends Factory
|
|
|
|
{
|
2020-04-21 12:41:27 -05:00
|
|
|
/**
|
|
|
|
* The name of the factory's corresponding model.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $model = User::class;
|
|
|
|
|
2020-04-21 10:12:39 -05:00
|
|
|
/**
|
|
|
|
* Define the model's default state.
|
|
|
|
*
|
2020-05-18 10:20:51 -05:00
|
|
|
* @return array
|
2020-04-21 10:12:39 -05:00
|
|
|
*/
|
|
|
|
public function definition()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'name' => $this->faker->name,
|
|
|
|
'email' => $this->faker->unique()->safeEmail,
|
|
|
|
'email_verified_at' => now(),
|
|
|
|
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
|
|
|
|
'remember_token' => Str::random(10),
|
|
|
|
];
|
|
|
|
}
|
2021-02-09 15:52:23 -05:00
|
|
|
|
|
|
|
/**
|
2021-02-16 10:58:28 -06:00
|
|
|
* Indicate that the model's email address should be unverified.
|
2021-02-09 15:52:23 -05:00
|
|
|
*
|
|
|
|
* @return \Illuminate\Database\Eloquent\Factories\Factory
|
|
|
|
*/
|
|
|
|
public function unverified()
|
|
|
|
{
|
|
|
|
return $this->state(function (array $attributes) {
|
|
|
|
return [
|
|
|
|
'email_verified_at' => null,
|
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
2020-04-21 10:12:39 -05:00
|
|
|
}
|