1App\Request::where('id',4)
2 ->whereHas('quotes', function ($query) {
3 $query->where('status','=','3');
4 })
5 ->with('quotes','sourceTable','destinationTable')
6 ->get();
7
1class Game extends Eloquent {
2 // many more stuff here
3
4 // relation without any constraints ...works fine
5 public function videos() {
6 return $this->hasMany('Video');
7 }
8
9 // results in a "problem", se examples below
10 public function available_videos() {
11 return $this->videos()->where('available','=', 1)->get();
12 }
13}