© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•8mo ago•
17 replies
Nedwor

Select dynamic placeholders

Hello everyone, I'm currently trying to make a select placeholder dynamic.

return Select::make('blabla')
    ->options([$this->options])
    ->live()
    ->disabled(function (Get $get) {
        return $get('is_occupied');
    })
    ->placeholder(function (Get $get) {
        $intervention = $get('intervention'); (something or null)
        return $intervention ?? __('my_placeholder');
    })
    ->afterStateUpdated(function (Set $set, Get $get, $state) {
        $this->handleSomething($set, $get, $state);
    });
return Select::make('blabla')
    ->options([$this->options])
    ->live()
    ->disabled(function (Get $get) {
        return $get('is_occupied');
    })
    ->placeholder(function (Get $get) {
        $intervention = $get('intervention'); (something or null)
        return $intervention ?? __('my_placeholder');
    })
    ->afterStateUpdated(function (Set $set, Get $get, $state) {
        $this->handleSomething($set, $get, $state);
    });


In this code I was hoping the placeholder to change if the $intervention is set to null or not. But no, it stays at the first thing it was built with. Good to know, This field is updated when I update a date field in the same form. And the disable works well, just the placeholder stays the same.

Is it possible or am I having a seizure ?
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

Dynamic Select Fields
FilamentFFilament / ❓┊help
3y ago
Visible with Select, dynamic inputs
FilamentFFilament / ❓┊help
2y ago
Dynamic select not saving data
FilamentFFilament / ❓┊help
3y ago
Dynamic number of select fields
FilamentFFilament / ❓┊help
3y ago