Laravel Querying Relations Model::has('relation') doesn't work
问题 In the Laravel documentation it says you can use this syntax for querying an object relation to get only the Posts that have at least one Comment: $posts = Post::has('comments')->get(); I'm trying something similar where I want to fetch only objects that have at least one relation object. These are my two classes: class Movie extends Eloquent { protected $table = 'movie'; public function matches() { return $this->hasMany("Match"); } } class Match extends Eloquent { protected $table = 'match';