Closed emredoganm closed 7 years ago
Also Category::has('children')->get()
or Category::has('parent')->get()
queries return empty collections. Maybe this problem related to the problem above... If not I can open a new issue.
Hi @emredoganm In your categories
model you declared two relationships to the same categories
model. Is this intended?
Is this un-solicited status? A category may has a parent category and children categories. How can I declare?
@emredoganm there doesn't seem to be anything wrong in the sample you posted. hasMany
means programming -[IS_CHILD_OF]-> children
declared with a hasMany
relationship. While programming <-[IS_CHILD_OF]- parent
declared with a belongsTo
. All as described in the docs https://github.com/vinelab/neoeloquent#one-to-many
Is there anything that you find confusing about this?
I think I should change my relation name to "HAS_CHILD". It is more smarter :-D
i have to reopen :smiley:
When i use createWith (with parent relationship inside), it is displayed correctly in graph preview.
But when i use $model->parent()->associate($parent)->save()
direction is displayed as edgeout..
In my
Categories
model, I declared relationships like this:but when I run this:
relationship direction has wrong direction.![image](https://cloud.githubusercontent.com/assets/6019496/24336706/7cc10dcc-129c-11e7-8674-c192a90a0e83.png)