📌  相关文章
📜  错误:在文件中为 null 时调用成员函数 addEagerConstraints() - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:37.845000             🧑  作者: 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');
    }