Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Error: Call to a member function addEagerConstraints() on null in file


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');
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Call #member #function #null #file
ADD COMMENT
Topic
Name
1+6 =