Problem with validation when DATAS relate #117
leonampuzlplace
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
wassup guys
First of all, sorry for my English, I don't speak native English.
I have the following problem.
I have the following DATAS
Each data has its validations.
CityData has validations so that it can be operated individually
StateData has validations so that it can be operated individually
When you register CityData, if I do not fill in the name of the city, for example, do not leave the validation in the request.
When you register StateData, if I do not fill in the name of the state, for example, do not leave the validation in the request.
Here comes the problem.
When I'm going to register a company and I don't want to inform the address data, or I don't want to inform the city for whatever reason I have, it generates an error in the validation.
Because I created the DATA relationship between CompanyAddressData[] and CityData, it always forces me to fill in the CityData and StateData information. Somentimes i just want city_id (fk) with null
I put in companyAddressDATA the following
public ?CityData $city
Already tried
public CityData|null $city
How do I get from CompanyAddress not doing the CityData and StateData checks?
Congratulations for laravel-data and all team
Obrigado, ;D
Beta Was this translation helpful? Give feedback.
All reactions