FilamentF
Filament2y ago
Xavi

TextInput multiple relations

I have this code

return $form
->schema([
    Section::make()
        ->schema([
            Grid::make()
                ->schema([
                    Group::make()
                        ->relationship('header')
                        ->schema([
                            TextInput::make('email')
                                ->formatStateUsing(function ($record) {
                                    return $record->user->email;
                                })
                                ->label(__('Cliente'))
                                ->disabled(),
                        ]),
                    Group::make()
                        ->relationship('campaign')
                        ->schema([
                            TextInput::make('description')
                                ->formatStateUsing(function ($record) {
                                    return $record->description;
                                })
                                ->label(__('Campaña'))
                                ->disabled(),
                        ]),
                ])->columns(2),
            Grid::make()
                ->relationship('header')
                ->schema([
                    TextInput::make('url')
                        ->label(__('URL'))
                        ->disabled(),
                ])->columns(1),
           
        ])
]);


Email field doesn't show content, but if i remove URL, email its showed. Both of fields its a relationship

I don't know how to fix it. Thanks!!!
Was this page helpful?