55use App \Enums \Role ;
66use App \Models \User ;
77use Illuminate \Database \Eloquent \Factories \Factory ;
8+ use Illuminate \Support \Facades \Hash ;
89use Illuminate \Support \Str ;
910
1011/**
@@ -19,7 +20,7 @@ public function definition()
1920 'last_name ' => \fake ()->lastName (),
2021 'email ' => \fake ()->unique ()->safeEmail (),
2122 'email_verified_at ' => \now (),
22- 'password ' => ' 12345 ' ,
23+ 'password ' => Hash:: make ( config ( ' seed.users.super.password ' )) ,
2324 'remember_token ' => Str::random (10 ),
2425 ];
2526 }
@@ -35,8 +36,8 @@ public function superAdmin(?string $email = null)
3536 {
3637 return $ this
3738 ->state (fn (array $ attributes ) => [
38- 'email ' => \ config ('seed.users.super.email ' ),
39- 'password ' => \ config ('seed.users.super.password ' ),
39+ 'email ' => config ('seed.users.super.email ' ),
40+ 'password ' => Hash:: make ( config ('seed.users.super.password ' ) ),
4041 ])
4142 ->afterCreating (function (User $ user ) {
4243 $ user ->assignRole (Role::SUPER_ADMIN );
@@ -47,8 +48,8 @@ public function admin()
4748 {
4849 return $ this
4950 ->state (fn (array $ attributes ) => [
50- 'email ' => \ config ('seed.users.admin.email ' ),
51- 'password ' => \ config ('seed.users.admin.password ' ),
51+ 'email ' => config ('seed.users.admin.email ' ),
52+ 'password ' => Hash:: make ( config ('seed.users.admin.password ' ) ),
5253 ])
5354 ->afterCreating (function (User $ user ) {
5455 $ user ->assignRole (Role::ADMIN );
@@ -59,8 +60,8 @@ public function user()
5960 {
6061 return $ this
6162 ->state (fn (array $ attributes ) => [
62- 'email ' => \ config ('seed.users.user.email ' ),
63- 'password ' => \ config ('seed.users.user.password ' ),
63+ 'email ' => config ('seed.users.user.email ' ),
64+ 'password ' => Hash:: make ( config ('seed.users.user.password ' ) ),
6465 ])
6566 ->afterCreating (function (User $ user ) {
6667 $ user ->assignRole (Role::USER );
0 commit comments