TextInput in edit One to One relationship

Am trying to get a One to One relationship into TextInput but the value is not shown in the TextInput , even though i printed the object and it has values in it , could anyone help please
4 Replies
Patrick Boivin
Patrick Boivin17mo ago
@abedrabaia Can you paste your code as text instead of screenshots? It's difficult to make a suggestion.
abedrabaia
abedrabaiaOP17mo ago
@pboivinIt's a long code but here is the files
Patrick Boivin
Patrick Boivin17mo ago
I'm not completely sure but something you can try:
Grid::make(1)
->schema([
TextInput::make('engine_make_model')
->label('Make & Model')
->placeholder('Make & Model'),
TextInput::make('engine_power_by_the_hour_plan')
->label('Power-By-The-Hour Plan')
->placeholder('Power-By-The-Hour Plan'),
Repeater::make('engineDetails')
->defaultItems(1)
->createItemButtonLabel('Add Engine')
->cloneable()
->grid(2)
->maxItems(4)
->minItems(1)
->schema([
// ...
]),
])
->relationship('engine')
Grid::make(1)
->schema([
TextInput::make('engine_make_model')
->label('Make & Model')
->placeholder('Make & Model'),
TextInput::make('engine_power_by_the_hour_plan')
->label('Power-By-The-Hour Plan')
->placeholder('Power-By-The-Hour Plan'),
Repeater::make('engineDetails')
->defaultItems(1)
->createItemButtonLabel('Add Engine')
->cloneable()
->grid(2)
->maxItems(4)
->minItems(1)
->schema([
// ...
]),
])
->relationship('engine')
Use relationship() on the wrapper component
abedrabaia
abedrabaiaOP17mo ago
@pboivin thank you it worked prefectly !
Want results from more Discord servers?
Add your server