📌  相关文章
📜  在 null 上调用成员函数 addEagerConstraints() - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:13.033000             🧑  作者: Mango

代码示例2
in your relationship you are missing return statement, 
please follow the following example

public function user() {
        $this->belongsTo(User::class,'user_id','id');
}

to 
  
public function user() {
        return $this->belongsTo(User::class,'user_id','id');
    }