F
Filament5mo ago
caglar

How to use an icon like a button

I'd like to show and hide password by clicking the icon. Is it possible to apply?
6 Replies
toeknee
toeknee5mo ago
This has just been after into V3.2
caglar
caglar5mo ago
TextEntry::make('password')
->label('Password')
->icon('heroicon-o-key')
->iconColor('primary')
->getStateUsing(function ($record) {
$credential = $record->credentials()->where('loginunpw', 1)->first();

return $credential ? $credential->pass : 'No Password Found';
})
->formatStateUsing(fn ($state): string => Str::mask('secret', '*', 0))
->copyable()
->copyableState(fn (string $state): string => $state)
->copyMessage('Copied!'),
TextEntry::make('password')
->label('Password')
->icon('heroicon-o-key')
->iconColor('primary')
->getStateUsing(function ($record) {
$credential = $record->credentials()->where('loginunpw', 1)->first();

return $credential ? $credential->pass : 'No Password Found';
})
->formatStateUsing(fn ($state): string => Str::mask('secret', '*', 0))
->copyable()
->copyableState(fn (string $state): string => $state)
->copyMessage('Copied!'),
caglar
caglar5mo ago
I'm using TextEntry class in an infolist and it doesn't work with password() method.
Tieme
Tieme5mo ago
It is not implemented on the infolist, only on forms.
caglar
caglar5mo ago
Thanks a lot.
Want results from more Discord servers?
Add your server
More Posts
Combining filter, search and sorting into one row... possible?When adding filtering, searching and sorting to a table we end up with 3 rows above the data. Is theHow to add autocomplete="off" to the form-element?I have a problem with Google Chrome autocompleting email and password-fields when editing a resourcerun dispatch before `public function table()`Hello, I want to run an dispatch function before the table function. Is there an way to do it? andDisable option Checkbox List more than 1 items```php use Filament\Forms\Components\CheckboxList; CheckboxList::make('technologies') ->optionDisplaying 'New' and 'Old' Changes from Spatie Activity Log in an InfoListHello everyone! 👋 I'm using the Spatie Activity Log package in my Laravel project to track model cSelect option is "0" after creating an entry through Select::make(...)->createOptionForm(...)**What I'm trying to do :** Allow users to add an option in a relationship select using the createOpHow to add css to custom theme?Hi Guys, Can someone please explain to me like to a 5 year old how to use full tailwindcss class. IHow to place Action Button on Resource Form by the Delete Button?I have the following Action in side a form, how can I add the button along side the Delete button? `Error when i search in table**I got this error when i search in the table i am using filament-spatie-translatable plugin ** ByUploading profile imageHello, I hope you're doing well. I'm new to Filament, and even after searching through the document