© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
howdu

Create select option form without relationship

Trying to use the createOptionForm so that it works without a relationship.

This almost works apart from the select value/select option, is not updated even though the state is updated correctly.

Forms\Components\Select::make('group')
    ->native()
    ->required()
    ->options(function ($state): array {
        $options = [];// fetch unique groups from DB
        if ($state && ! isset($options[$state])) {
            $options[$state] = $state;
        }
        return $options;
    })
    ->createOptionForm(fn (): array => [
        Forms\Components\TextInput::make('group')
    ])
    ->createOptionUsing(fn (array $data) => $data['group']),
Forms\Components\Select::make('group')
    ->native()
    ->required()
    ->options(function ($state): array {
        $options = [];// fetch unique groups from DB
        if ($state && ! isset($options[$state])) {
            $options[$state] = $state;
        }
        return $options;
    })
    ->createOptionForm(fn (): array => [
        Forms\Components\TextInput::make('group')
    ])
    ->createOptionUsing(fn (array $data) => $data['group']),
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

Create Option Form
FilamentFFilament / ❓┊help
3y ago
Select All option in relationship Select
FilamentFFilament / ❓┊help
2y ago
Form select relationship help
FilamentFFilament / ❓┊help
11mo ago
make select without relationship
FilamentFFilament / ❓┊help
2y ago