This is relationship in model
public function article_children() {
return $this->hasMany(self::class, 'parent_id',self::PRIMARY_KEY);
}
I am calling it with this line
$article_type = ArticleType::with('article_children')->find($id);
My code works nice but what annoys me is that I have to pass method name 'article_children' as string and I am trying to avoid that ...
ideal solution would be
$article_type = ArticleType::with(ArticleType::someReferenceToMethodArticleChildren)->find($id);
So In far far away future I will have option to just CRTL + CLick on that reference and it would lead me directly to relation method in PHP-Storm.
If any one knows the answer how to improve that part of code let me know :)