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

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -