F
Filament16mo ago
Wannes

Hidden fields

Hi, is there a way in a filament table to "hide" fields? With hiding I mean showing them like "**" and retrieving the values with an eye. Something like type='password'.
5 Replies
Abdur Razzaque
Abdur Razzaque16mo ago
Maybe avaible like this: ->hidden('isHidden')
LeandroFerreira
LeandroFerreira16mo ago
something like this? insecure way squint
ViewColumn::make('my_column')->view('custom-column')
ViewColumn::make('my_column')->view('custom-column')
<!-- resources/views/custom-column.blade.php -->
<div>
<a x-data="{ toggle: true }" href="#" @click="toggle = !toggle">
<span x-text="toggle ? '*******' : '{{ $getState() }}'"></span>
</a>
</div>
<!-- resources/views/custom-column.blade.php -->
<div>
<a x-data="{ toggle: true }" href="#" @click="toggle = !toggle">
<span x-text="toggle ? '*******' : '{{ $getState() }}'"></span>
</a>
</div>
nielsdscrd
nielsdscrd16mo ago
Was looking for the same. Ended up with this:
Section::make([
TextInput::make('username')
->label(__('Username')),
TextInput::make('password')
->label(__('Password'))
->formatStateUsing(function ($record) {
return $record->getPassword();
})->visible(fn(Get $get): bool => $get('reveal_password')),
Toggle::make('reveal_password')
->default(false)->live(),
])
Section::make([
TextInput::make('username')
->label(__('Username')),
TextInput::make('password')
->label(__('Password'))
->formatStateUsing(function ($record) {
return $record->getPassword();
})->visible(fn(Get $get): bool => $get('reveal_password')),
Toggle::make('reveal_password')
->default(false)->live(),
])
LeandroFerreira
LeandroFerreira16mo ago
actually we have a table column not form..
nielsdscrd
nielsdscrd16mo ago
Ah, apologies. I overlooked that.
Want results from more Discord servers?
Add your server