Hi All,
I have a question regarding to create item and relationship items.
The scenario:
I have created 2 tables "country" and "city". The relationship between country and city is oneToMany 1-N.
So, is it possible to use the POST Country API to create a new cities?
Curl Request example:
`
curl --location --request POST 'http://laravelnew:8888/api/v1/countries'
--header 'Accept: application/vnd.api+json'
--header 'Content-Type: application/vnd.api+json'
--data-raw '{
"data":
{
"type": "countries",
"attributes": {
"name": "Country A",
},
"relationships":{
"cities":{
"data":[{"name":"City A"},{"name":"City B"}]
}
}
}
}'
`