diff --git a/src/Resources/UserResource.php b/src/Resources/UserResource.php index 81139e4..471a71a 100644 --- a/src/Resources/UserResource.php +++ b/src/Resources/UserResource.php @@ -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')){ diff --git a/stubs/UserResource.stub b/stubs/UserResource.stub index 686c84b..2e523bb 100644 --- a/stubs/UserResource.stub +++ b/stubs/UserResource.stub @@ -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')){