© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
6 replies
Vp

textinput prefix with select dropdown

I am trying to create like image, but I stuck at few points. I can achieve only design like below
Forms\Components\TextInput::make('mobile')
    ->prefix(
        new HtmlString(Blade::render('
            <x-filament::input.select wire:model="status">
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">4</option>
            </x-filament::input.select>
        '))
    ),
Forms\Components\TextInput::make('mobile')
    ->prefix(
        new HtmlString(Blade::render('
            <x-filament::input.select wire:model="status">
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">4</option>
            </x-filament::input.select>
        '))
    ),

But there are two (or more maybe) problems comes:
1. How can I pass variable and loop through select options
2. How can I have these data (selected) for store/edit etc

How can I make it work for these points, or any other alternative ways to achieve the same
Screenshot_from_2024-03-27_11-53-35.png
Solution
I end up doing closure, need to return HtmlString
->prefix(function () {
    return new HtmlString(view('phone-input'));
})
->prefix(function () {
    return new HtmlString(view('phone-input'));
})
Jump to solution
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

TextInput "prefix" not showing
FilamentFFilament / ❓┊help
3y ago
Hide Select Dropdown depends on the Select Dropdown value?
FilamentFFilament / ❓┊help
2y ago
Select dependant from TextInput
FilamentFFilament / ❓┊help
3y ago
ViewRecord - Adding Select Dropdown
FilamentFFilament / ❓┊help
2y ago