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 55use App \Models \User ;
66use Illuminate \Support \Facades \Hash ;
77use Illuminate \Support \Facades \Validator ;
8+ use Illuminate \Support \Str ;
89use Illuminate \Validation \Rule ;
910use Laravel \Fortify \Contracts \CreatesNewUsers ;
1011
@@ -35,6 +36,7 @@ public function create(array $input): User
3536 'string ' ,
3637 'min:6 ' ,
3738 'max:20 ' ,
39+ 'alpha_dash ' ,
3840 Rule::unique (User::class, 'username ' ),
3941 ],
4042 'password ' => $ this ->passwordRules (),
@@ -43,9 +45,9 @@ public function create(array $input): User
4345 return User::create ([
4446 'name ' => $ input ['name ' ],
4547 'email ' => $ input ['email ' ],
46- 'username ' => $ input ['username ' ],
47- 'opt_in ' => isset ($ input ['opt_in ' ]),
48+ 'username ' => Str::lower ($ input ['username ' ]),
4849 'password ' => Hash::make ($ input ['password ' ]),
50+ 'opt_in ' => isset ($ input ['opt_in ' ]),
4951 ]);
5052 }
5153}
You can’t perform that action at this time.
0 commit comments