File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 5
5
use App \Models \User ;
6
6
use Illuminate \Support \Facades \Hash ;
7
7
use Illuminate \Support \Facades \Validator ;
8
+ use Illuminate \Support \Str ;
8
9
use Illuminate \Validation \Rule ;
9
10
use Laravel \Fortify \Contracts \CreatesNewUsers ;
10
11
@@ -35,6 +36,7 @@ public function create(array $input): User
35
36
'string ' ,
36
37
'min:6 ' ,
37
38
'max:20 ' ,
39
+ 'alpha_dash ' ,
38
40
Rule::unique (User::class, 'username ' ),
39
41
],
40
42
'password ' => $ this ->passwordRules (),
@@ -43,9 +45,9 @@ public function create(array $input): User
43
45
return User::create ([
44
46
'name ' => $ input ['name ' ],
45
47
'email ' => $ input ['email ' ],
46
- 'username ' => $ input ['username ' ],
47
- 'opt_in ' => isset ($ input ['opt_in ' ]),
48
+ 'username ' => Str::lower ($ input ['username ' ]),
48
49
'password ' => Hash::make ($ input ['password ' ]),
50
+ 'opt_in ' => isset ($ input ['opt_in ' ]),
49
51
]);
50
52
}
51
53
}
You can’t perform that action at this time.
0 commit comments