I have a Quote model:
class Quote extends Eloquent {
public function quote_lines() {
return $this->hasMany(\'QuoteLine\');
}
}
>
I have the exact same problem with Laravel 4.1, and the solution suggested by this comment solved it for me.
Putting an underscore anywhere in the function name causes it to return null
:
public function quo_telines() {
return $this->hasMany('QuoteLine');
}
Removing the underscore resolves the issue. Apparently, Eloquent doesn't like to have an underscore in the function name.
However, note that the function name must not match any of the schema's column names, or you'll get other issues.