Laravel 一对一对多,三张表关联
laravel 模型关联中 如何同时关联三张表
我有一张user 表
一张post表
一张resume表
我想通过AdminUser的ID查询到第三张resume表的字段
使用以下代码却查询不到任何数据
AdminUser::find()->postes->resumes;
在AdminUser的Model中多加一个或直接修改
public function postAndResumes { return $this->belongToMany('App\Model\Post','post_leader', 'name')->with('resumes'); }