components([ TextInput::make('name') ->label('Nama') ->placeholder('John Doe') ->required() ->maxLength(100) ->autofocus() ->autocomplete(false), TextInput::make('phone_number') ->label('Nomor HP') ->placeholder('08xxxxxxxxxx') ->required() ->maxLength(20) ->autocomplete(false), TextInput::make('address') ->label('Alamat') ->placeholder('Jl. Raya No. 123, Jakarta Selatan') ->maxLength(255) ->autocomplete(false), ]) ->columns(1); } public static function table(Table $table): Table { return $table ->columns([ TextColumn::make('name') ->label('Nama') ->searchable() ->sortable(), TextColumn::make('phone_number') ->label('Nomor HP') ->searchable() ->sortable(), TextColumn::make('address') ->label('Alamat') ->limit(40) ->toggleable(isToggledHiddenByDefault: true), ...TimestampColumns::make(), ]) ->filters([ TrashedFilter::make() ->native(false), ]) ->recordActions([ EditAction::make() ->modalWidth(Width::Large), DeleteAction::make(), ForceDeleteAction::make(), RestoreAction::make(), ]) ->toolbarActions([ BulkActionGroup::make([ ...DefaultBulkActions::make('Pelanggan'), ]), ]) ->emptyStateIcon(Heroicon::UserPlus) ->emptyStateDescription('Setelah Anda membuat data pertama, maka akan muncul disini.') ->defaultSort('created_at', 'desc') ->deferFilters(false); } public static function getPages(): array { return [ 'index' => ManageCustomers::route('/'), ]; } public static function getRecordRouteBindingEloquentQuery(): Builder { return parent::getRecordRouteBindingEloquentQuery() ->withoutGlobalScopes([ SoftDeletingScope::class, ]); } }