Skip to content

Commit

Permalink
Use new "fake" standard for UserFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
joelbutcher committed Oct 23, 2023
1 parent e74e149 commit 22446ee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
8 changes: 3 additions & 5 deletions stubs/breeze/database/factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ public function definition(): array
*/
public function unverified(): static
{
return $this->state(function (array $attributes) {
return [
'email_verified_at' => null,
];
});
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}

/**
Expand Down
12 changes: 5 additions & 7 deletions stubs/filament/database/factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class UserFactory extends Factory
public function definition(): array
{
return [
'name' => $this->faker->name(),
'email' => $this->faker->unique()->safeEmail(),
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'two_factor_secret' => null,
Expand All @@ -37,11 +37,9 @@ public function definition(): array
*/
public function unverified(): static
{
return $this->state(function (array $attributes) {
return [
'email_verified_at' => null,
];
});
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}

/**
Expand Down
12 changes: 5 additions & 7 deletions stubs/jetstream/database/factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class UserFactory extends Factory
public function definition(): array
{
return [
'name' => $this->faker->name(),
'email' => $this->faker->unique()->safeEmail(),
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'two_factor_secret' => null,
Expand All @@ -40,11 +40,9 @@ public function definition(): array
*/
public function unverified(): static
{
return $this->state(function (array $attributes) {
return [
'email_verified_at' => null,
];
});
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}

/**
Expand Down

0 comments on commit 22446ee

Please sign in to comment.