Closed devhoussam1998 closed 9 months ago
I don't think a double nested dot syntax is supported. Have you tried without it? It doesn't seem to me it's necessary.
public function parent(): BelongsTo { return $this->belongsTo(Page::class, 'parent_id'); }
How I can achieve
expected result:
public function parent(): BelongsTo
{
return $this->belongsTo(Page::class, 'parent_id');
}
Sorry, I don't understand your reply. I think if you simply write parent_id: foreign:Page
it should work. However, Blueprint is about conventions. So it may not have syntax for naming the relationship something unconventional.
You could try setting the column to something else, like unsigned bigInt
then setting the belongsTo
relationship. Again, there are a few different ways to set relationships. One of them may get you what you need. But if not it's an easy enough change to do yourself.
Issue:
first of all I did not find any way to communicate I can't send a message on twitter and there is no Discussions that's why I add my question here
parent_id: foreign:page.parents.id
What I get:
expected result:
draft.yaml: