© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
yukebrillianth

select field value not populating on edit when using realtion modifyQueryUsing

Select::make('voucher_id')
        ->label('Voucher Code')
        ->relationship(name: 'voucher', titleAttribute: 'code', modifyQueryUsing: fn (Builder $query) => $query->with('package')->where('status', 'fresh'))
         ->prefixIcon('heroicon-o-ticket')
         ->disabled(Voucher::where('status', 'fresh')->get()->isEmpty())
         ->required(),
Select::make('voucher_id')
        ->label('Voucher Code')
        ->relationship(name: 'voucher', titleAttribute: 'code', modifyQueryUsing: fn (Builder $query) => $query->with('package')->where('status', 'fresh'))
         ->prefixIcon('heroicon-o-ticket')
         ->disabled(Voucher::where('status', 'fresh')->get()->isEmpty())
         ->required(),
image.png
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

default value on form select not populating
FilamentFFilament / ❓┊help
3y ago
Select options not populating
FilamentFFilament / ❓┊help
2y ago
Select value when using allowHtml
FilamentFFilament / ❓┊help
3y ago
Select Field empty on Edit Page
FilamentFFilament / ❓┊help
2y ago