wally
wally
FFilament
Created by wally on 4/5/2024 in #❓┊help
set value in form field when there is a relationship
Friends I have a problem... I have a resource that performs an API query, the data is returned normally and I $set the value obtained in the query in its respective form field.
" $set('zip_code', $cnpjData['cep']); $set('street', Str::title($cnpjData['logradouro']) ); $set('number', $cnpjData['numero']); $set('district', Str::title($cnpjData['bairro'])); $set('city', Str::title($cnpjData['municipio']));" However, in this form I have a relationship with an address table "Fieldset::make('Informações de Endereço') ->relationship('company_address') ->schema([ Cep::make('zip_code') ->label('CEP') ->columnSpan(1), TextInput::make('street') ->label('Logradouro') ->columnSpan(2) ->required() ->maxLength(255)," If I remove the ( ->relationship('company_address')) the information is filled in normally when I have the searched data returned, However, if I leave this option, when I search for data in the API, these fields are not filled in. Can someone help me?
2 replies