File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,16 @@ class UserRepository extends Repository
1515 return [
1616 Field::make('name')->rules('required'),
1717
18- Field::make('email')->rules('required')->storingRules('unique:users')->messages([
19- 'required' => 'This field is required.',
20- ]),
18+ Field::make('email')->rules('required')
19+ ->storingRules('unique:users')->messages([
20+ 'required' => 'This field is required.',
21+ ]),
2122
22- Field::make('password')->storeCallback(function ($request, $model, $attribute) {
23- $model->{$attribute} = Hash::make($value);
24- })->rules('required')->storingRules('confirmed'),
23+ Field::make('password')
24+ ->value(fn(Request $request) => Hash::make($request->input('password')))
25+ ->rules('required')
26+ ->storingRules('confirmed')
27+ ->hidden(),
2528 ];
2629 }
2730}
You can’t perform that action at this time.
0 commit comments