JonatasBraz
Explore posts from serversNested Relationships data not beeing saved
i've created this simple repository to test the problem. https://github.com/JonatasBSM/belongsToTeste
it has cidades resource, that tries to create cidade, estado and pais ($cidade->belongsTo->estado->belongsTo->pais),
and pais resource, that tries to create pais, estado and cidade ($pais->hasOne->estado->hasOne->cidade). i know it should be hasMany in this cases, but was just to show the problem. when creating through cidades, it dont save pais and when creating through pais, it works as it should
for tests, just clone the repository, composer install and create a database called belongstotest
5 replies