File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 66use App \Models \User ;
77use Illuminate \Contracts \View \View ;
88use Illuminate \Support \Facades \Auth ;
9+ use Illuminate \Support \Facades \Hash ;
10+ use Illuminate \Validation \Rules ;
911use Livewire \Component ;
1012
1113class Profile extends Component
@@ -34,8 +36,8 @@ public function rules(): array
3436 'password ' => [
3537 'nullable ' ,
3638 'string ' ,
37- 'min:8 ' ,
38- ' confirmed '
39+ 'confirmed ' ,
40+ Rules \Password:: defaults ()
3941 ]
4042 ];
4143 }
@@ -49,7 +51,7 @@ public function save(): void
4951 {
5052 $ this ->validate ();
5153
52- $ this ->user ->password = when ($ this ->password !== null , bcrypt ($ this ->password ), $ this ->user ->password );
54+ $ this ->user ->password = when ($ this ->password !== null , Hash:: make ($ this ->password ), $ this ->user ->password );
5355 $ this ->user ->update ();
5456
5557 $ this ->dispatch ('updated ' , name: $ this ->user ->name );
You can’t perform that action at this time.
0 commit comments