feat: Auto-verify new user emails upon creation and remove recordTitleAttribute and autocomplete(false) from the user resource.
This commit is contained in:
parent
974d8ac92b
commit
f1d1058868
@ -9,10 +9,10 @@
|
||||
|
||||
class ManageUsers extends ManageRecords
|
||||
{
|
||||
protected static ?string $title = 'Pengguna';
|
||||
|
||||
protected static string $resource = UserResource::class;
|
||||
|
||||
protected static ?string $title = 'Pengguna';
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
@ -25,7 +25,14 @@ protected function getHeaderActions(): array
|
||||
$action->makeModalSubmitAction('createAnother', arguments: ['another' => true])
|
||||
->label('Simpan dan Tambah Lagi'),
|
||||
])
|
||||
->modalWidth(Width::Large),
|
||||
->modalWidth(Width::Large)
|
||||
->after(function (CreateAction $action): void {
|
||||
$user = $action->getRecord();
|
||||
|
||||
$user->update([
|
||||
'email_verified_at' => now(),
|
||||
]);
|
||||
}),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ class UserResource extends Resource
|
||||
|
||||
protected static ?int $navigationSort = 8;
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'name';
|
||||
// protected static ?string $recordTitleAttribute = 'name';
|
||||
|
||||
protected static ?string $slug = 'master/users';
|
||||
|
||||
@ -86,8 +86,7 @@ public static function form(Schema $schema): Schema
|
||||
})
|
||||
->multiple()
|
||||
->preload()
|
||||
->searchable()
|
||||
->autocomplete(false),
|
||||
->searchable(),
|
||||
|
||||
Hidden::make('password')
|
||||
->default(fn (?User $record): ?string => $record ? null : config('auth.password_default')),
|
||||
@ -98,7 +97,6 @@ public static function form(Schema $schema): Schema
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->recordTitleAttribute('name')
|
||||
->columns([
|
||||
TextColumn::make('name')
|
||||
->label('Nama')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user