|
6 | 6 |
|
7 | 7 | class UserFactory extends Factory |
8 | 8 | { |
9 | | - // If this model property isn't defined, Leaf will |
10 | | - // try to generate the model name from the factory name |
11 | | - public $model = User::class; |
| 9 | + // If this model property isn't defined, Leaf will |
| 10 | + // try to generate the model name from the factory name |
| 11 | + public $model = User::class; |
12 | 12 |
|
13 | | - // You define your factory blueprint here |
14 | | - // It should return an associative array |
15 | | - public function definition(): array |
16 | | - { |
17 | | - return [ |
18 | | - 'id' => $this->faker->unique()->numberBetween(0, 200), |
19 | | - 'username' => strtolower(implode("-", explode(" ", $this->faker->name))), |
| 13 | + // You define your factory blueprint here |
| 14 | + // It should return an associative array |
| 15 | + public function definition(): array |
| 16 | + { |
| 17 | + return [ |
| 18 | + 'username' => strtolower($this->faker->firstName), |
20 | 19 | 'fullname' => $this->faker->name, |
21 | | - 'email' => $this->faker->unique()->safeEmail, |
22 | | - 'email_verified_at' => \Leaf\Date::now(), |
23 | | - 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password |
24 | | - // $this->str is defined in the base factory |
25 | | - 'remember_token' => $this->str::random(10), |
26 | | - ]; |
27 | | - } |
| 20 | + 'email' => $this->faker->unique()->safeEmail, |
| 21 | + 'email_verified_at' => tick()->now(), |
| 22 | + 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password |
| 23 | + // $this->str is defined in the base factory |
| 24 | + 'remember_token' => $this->str::random(10), |
| 25 | + ]; |
| 26 | + } |
28 | 27 | } |
0 commit comments