F
Filament3mo 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),

])
]);
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!!!
7 Replies
Dennis Koch
Dennis Koch3mo ago
Not sure whether 2 groups with the same reltionship work flawlesssly
Xavi
Xavi3mo ago
no it doesn't works. How can i do to works?
LeandroFerreira
LeandroFerreira3mo ago
One group/relationship will work..
Xavi
Xavi3mo ago
yes one group/relationship works, but second one doesn't works, and i need to works with two different groups for visual structure propose 😦
Dennis Koch
Dennis Koch3mo ago
I guess that Filament doesn't support this as both groups have a conflict.
Xavi
Xavi3mo ago
oh 😦 Ok thanks Dennis!
LeandroFerreira
LeandroFerreira3mo ago
I think as well