laravel 4 - Call to undefined method Illuminate\Database\Query\Builder::with() in Repository -
i trying follow tutorial below reason make method doesn't work in case. when try use explained in tutorial error: call undefined method illuminate\database\query\builder::with()
http://culttt.com/2014/03/17/eloquent-tricks-better-repositories/
public function make(array $with = array()) { return $this->model->with($with); } then try use follows:
public function parents(array $with = array()) { $query = $this->make($with); return $query->wherenull('parent_id')->get(); } this different code in tutorial shouldn't make difference. when use exact same example breaks error above.
it turns out if have typo in relationship you're trying pull in scenario give error. it's highly confusing.
Comments
Post a Comment