Trying to do a simple eager load with Laravel 4 using a many to many relationships. My Models look like.
class Facility extends Eloquent {
public function photos(){
return $this->belongsToMany('Photo');
}
}
class Photo extends Eloquent {
public function facilities(){
return $this->belongsToMany('Facility');
}
}
Tabes are set up according to Laravel standards. When I try to load using
$facilities = Facility::with('Photo')->get();
I end up with a Laravel error
Call to undefined method Illuminate\Database\Query\Builder::photo()
Any idea whats being done wrong here?