Skip to content

Commit b741f92

Browse files
committed
wip
1 parent c82d11e commit b741f92

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/Commands/stubs/user-repository.stub

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)