ldc-dam/database/factories/UserFactory.php

41 lines
965 B
PHP
Raw Normal View History

2019-05-09 15:00:05 +02:00
<?php
2022-04-19 14:49:09 +02:00
namespace Database\Factories;
2022-04-19 10:49:38 +02:00
2022-04-19 14:49:09 +02:00
use Illuminate\Database\Eloquent\Factories\Factory;
2022-04-19 10:49:38 +02:00
use Illuminate\Support\Str;
2019-05-09 15:00:05 +02:00
2022-04-19 14:49:09 +02:00
class UserFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->name(),
'email' => $this->faker->unique()->safeEmail(),
'email_verified_at' => now(),
2022-04-19 16:07:27 +02:00
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',
// password
2022-04-19 14:49:09 +02:00
'remember_token' => Str::random(10),
];
}
2019-05-09 15:00:05 +02:00
2022-04-19 14:49:09 +02: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,
];
});
}
}