© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
7 replies
Husky110

Display Relationshipvalue in View-Form on Resource-Modal

Hi - Since Discord decides to bug out on the search-function and scrolling the result and I can't find it anywhere, could someone please point me in the right direction?
I got a Resource and wanna do a quick view-action, so I build up the
form()
form()
-method like this:
public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Forms\Components\TextInput::make('myrelation.worker')
                    ->label('Queue'),
                Forms\Components\TextInput::make('myrelation.jobkey')
                    ->label('Job'),
                Forms\Components\Textarea::make('message')
                    ->label('Fehlernachricht'),
                Forms\Components\Textarea::make('job_data')
                    ->label('Payload'),
                Forms\Components\Textarea::make('trace')
                    ->label('Trace')
                    ->columnSpan(2),

            ]);
    }
public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Forms\Components\TextInput::make('myrelation.worker')
                    ->label('Queue'),
                Forms\Components\TextInput::make('myrelation.jobkey')
                    ->label('Job'),
                Forms\Components\Textarea::make('message')
                    ->label('Fehlernachricht'),
                Forms\Components\Textarea::make('job_data')
                    ->label('Payload'),
                Forms\Components\Textarea::make('trace')
                    ->label('Trace')
                    ->columnSpan(2),

            ]);
    }

The fields on the record itself work fine, but the RelationShip-Fields on "myrelation" are empty. I found how to fix that on selects, but not on TextInputs. How can I fill those fields with their respected values? (I don't think that I have a typo on the notions.)
Solution
->formatStateUsing(fn($record) => $record->myrelation->worker)

?
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Modal in form Resource
FilamentFFilament / ❓┊help
3y ago
Display existing form in action modal
FilamentFFilament / ❓┊help
15mo ago
Testing modal form in resource relation
FilamentFFilament / ❓┊help
13mo ago
Modify size on modal view of resource
FilamentFFilament / ❓┊help
16mo ago