Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit 9ce2f5a

Browse files
committed
fix: update leaf db in example factory
1 parent b055b77 commit 9ce2f5a

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

app/database/factories/UserFactory.php

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,22 @@
66

77
class UserFactory extends Factory
88
{
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;
1212

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),
2019
'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+
}
2827
}

0 commit comments

Comments
 (0)