Skip to content

Commit

Permalink
Merge pull request #13 from 3x1io/dev
Browse files Browse the repository at this point in the history
fix update password #12
  • Loading branch information
3x1io committed Jan 28, 2023
2 parents 54701ea + 6643c1e commit 967e62c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Resources/UserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ public static function form(Form $form): Form
Forms\Components\TextInput::make('password')->label(trans('filament-user::user.resource.password'))
->password()
->maxLength(255)
->dehydrateStateUsing(fn ($state) => !empty($state) ? Hash::make($state) : ""),
->dehydrateStateUsing(static function ($state){
if(!empty($state)){
return Hash::make($state);
}
}),
];

if(config('filament-user.shield')){
Expand Down
6 changes: 5 additions & 1 deletion stubs/UserResource.stub
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ class UserResource extends Resource
Forms\Components\TextInput::make('password')->label(trans('filament-user::user.resource.password'))
->password()
->maxLength(255)
->dehydrateStateUsing(fn ($state) => !empty($state) ? Hash::make($state) : ""),
->dehydrateStateUsing(static function ($state){
if(!empty($state)){
return Hash::make($state);
}
}),
];

if(config('filament-user.shield')){
Expand Down

0 comments on commit 967e62c

Please sign in to comment.