Skip to content

Commit 4be9953

Browse files
authored
Merge pull request #18 from nathanheffley/patch-1
Use PasswordValidationRules trait in CreateNewUser action
2 parents f29ed3f + f78847f commit 4be9953

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

stubs/CreateNewUser.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
use Illuminate\Support\Facades\Hash;
77
use Illuminate\Support\Facades\Validator;
88
use Laravel\Fortify\Contracts\CreatesNewUsers;
9-
use Laravel\Fortify\Rules\Password;
109

1110
class CreateNewUser implements CreatesNewUsers
1211
{
12+
use PasswordValidationRules;
13+
1314
/**
1415
* Validate and create a newly registered user.
1516
*
@@ -21,7 +22,7 @@ public function create(array $input)
2122
Validator::make($input, [
2223
'name' => ['required', 'string', 'max:255'],
2324
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
24-
'password' => ['required', 'string', new Password, 'confirmed'],
25+
'password' => $this->passwordRules(),
2526
])->validate();
2627

2728
return User::create([

0 commit comments

Comments
 (0)