Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Nov 6, 2023
1 parent 5038b63 commit d336a5a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Console/stubs/user-factory.stub
Expand Up @@ -3,6 +3,7 @@
namespace {{ factoryNamespace }};

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
use {{ namespacedModel }};

Expand All @@ -11,6 +12,8 @@ use {{ namespacedModel }};
*/
class UserFactory extends Factory
{
protected static ?string $password;

/**
* The name of the factory's corresponding model.
*
Expand All @@ -29,7 +32,7 @@ class UserFactory extends Factory
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
];
}
Expand Down

0 comments on commit d336a5a

Please sign in to comment.