© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•16mo ago•
31 replies
Martin Oscar

use `configureUsing` to avoid repetition

I have many password fields in my application so i'd like to use
class AdminPanelProvider extends PanelProvider
{
    public function boot()
    TextInput::configureUsing(function (TextInput $component) {
        $component->isPassword() && $component->revealable(config('panel.password.revealable'));
        }, isImportant: true);
    }
class AdminPanelProvider extends PanelProvider
{
    public function boot()
    TextInput::configureUsing(function (TextInput $component) {
        $component->isPassword() && $component->revealable(config('panel.password.revealable'));
        }, isImportant: true);
    }

Problem is this is the boot function runs BEFORE the component is created i want it to execute after so i don't have to manually add
->revealable(config('panel.password.revealable'))
->revealable(config('panel.password.revealable'))
to every TextInput of the password kind.


I tried using
dump($component->isPassword());
dump($component->isPassword());
and it will always return
false
false
same goes for
dump($component->getType());
dump($component->getType());
it will always return
text
text
even though its a
password
password
,
email
email
or
alphanumeric
alphanumeric
field.

I don't want to make my own component just for passwords cause i want to apply similar edit to other components as well

Thanks for your help 🙂
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Override configureUsing ?
FilamentFFilament / ❓┊help
16mo ago
conditional configureusing
FilamentFFilament / ❓┊help
2y ago
Possible to use configureUsing for Filament\Tables\Actions\ActionGroup ?
FilamentFFilament / ❓┊help
2y ago
Override Table::configureUsing
FilamentFFilament / ❓┊help
6mo ago