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