© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
2 replies
Leetz Eh?

Fill Select on relationmanager creation form

How can i pre-fill parent relation selector on a create form on a relationmananger?
On the Practice View, i have a Patient relationmanager, and when i create a new patient on that page, i want to have already selected the practice, but i'm not sure how I can implement that.

Select::make('practice_id')
    ->label('Practice')
    ->helperText(fn (string $operation) => $operation !== 'view' ? 'If the practice you are looking for is not in the list, please make sure it has a filled name.' : '')
    ->placeholder('Select a practice')
    ->options(fn () => Practice::all()
        ->pluck('filled_name', 'id')
        ->sort(SORT_NATURAL | SORT_FLAG_CASE)
        ->toArray()
    ),
Select::make('practice_id')
    ->label('Practice')
    ->helperText(fn (string $operation) => $operation !== 'view' ? 'If the practice you are looking for is not in the list, please make sure it has a filled name.' : '')
    ->placeholder('Select a practice')
    ->options(fn () => Practice::all()
        ->pluck('filled_name', 'id')
        ->sort(SORT_NATURAL | SORT_FLAG_CASE)
        ->toArray()
    ),


I tried using afterStateHydrated, but I'm not sure which injections i need to get to get the ID of the practice of which page I'm on right now.
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

Dependent Select -> Form Fill Issue
FilamentFFilament / ❓┊help
15mo ago
Select multiple - fill
FilamentFFilament / ❓┊help
8mo ago
Select::createOptionForm fill?
FilamentFFilament / ❓┊help
16mo ago
RelationManager form actions
FilamentFFilament / ❓┊help
2y ago