refactor: Adjust password field to set a default value only on creation and be visible only during creation.

This commit is contained in:
Yoga Pangestu 2026-01-29 21:20:35 +07:00
parent 705dfe6537
commit dceeabdf7e

View File

@ -88,7 +88,8 @@ public static function form(Schema $schema): Schema
->searchable(),
Hidden::make('password')
->default(fn (?User $record): ?string => $record ? null : config('auth.password_default')),
->default(fn (): string => config('auth.password_default'))
->visibleOn('create'),
])
->columns(1);
}