Edit: I have figured out a way to do it using custom field and column types. If there is any interest, I will try to post my solution here, please let me know.


我最近切换到Laravel Backpack来管理我的管理面板,但我现在遇到了一个重大问题 .

我的数据库中有 PagesArticlesTitles .

PageArticle 可以有很多 Titles (每个用于不同的语言,德语 Headers ,英文 Headers 等),因此它们通过多态1:n关系连接:

public function titles()
{
    return $this->morphMany('App\Models\Title', 'titleable');
}

现在,当我编辑我的页面(或文章)时, I want to also be able to edit all related titles . 根据我的理解,this is not possible at all在背包中我很惊讶在编辑它时没有显示模型的多态关系的原生支持 .

我是否想念一些东西,或者这根本不可能带背包?

谢谢你的任何建议 .