F
Filament8mo 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 Koch8mo ago
Not sure whether 2 groups with the same reltionship work flawlesssly
Xavi
XaviOP8mo ago
no it doesn't works. How can i do to works?
LeandroFerreira
LeandroFerreira8mo ago
One group/relationship will work..
Xavi
XaviOP8mo 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 Koch8mo ago
I guess that Filament doesn't support this as both groups have a conflict.
Xavi
XaviOP8mo ago
oh 😦 Ok thanks Dennis!
LeandroFerreira
LeandroFerreira8mo ago
I think as well
Want results from more Discord servers?
Add your server