{"action":"closed","issue":{"url":"https://api.github.com/repos/willvincent/laravel-rateable/issues/11","repository_url":"https://api.github.com/repos/willvincent/laravel-rateable","labels_url":"https://api.github.com/repos/willvincent/laravel-rateable/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/willvincent/laravel-rateable/issues/11/comments","events_url":"https://api.github.com/repos/willvincent/laravel-rateable/issues/11/events","html_url":"https://github.com/willvincent/laravel-rateable/issues/11","id":171873545,"number":11,"title":"List App\\Model order by Average Rating?","user":{"login":"maximusblade","id":13944020,"avatar_url":"https://avatars.githubusercontent.com/u/13944020?v=3","gravatar_id":"","url":"https://api.github.com/users/maximusblade","html_url":"https://github.com/maximusblade","followers_url":"https://api.github.com/users/maximusblade/followers","following_url":"https://api.github.com/users/maximusblade/following{/other_user}","gists_url":"https://api.github.com/users/maximusblade/gists{/gist_id}","starred_url":"https://api.github.com/users/maximusblade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maximusblade/subscriptions","organizations_url":"https://api.github.com/users/maximusblade/orgs","repos_url":"https://api.github.com/users/maximusblade/repos","events_url":"https://api.github.com/users/maximusblade/events{/privacy}","received_events_url":"https://api.github.com/users/maximusblade/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-18T10:53:52Z","updated_at":"2016-10-05T04:14:58Z","closed_at":"2016-10-05T04:14:58Z","body":"I'm having trouble finding  out how to list a ratable models\r\nOrder by average rating ?\r\n\r\nI think this is completely the wrong way to go about it...but this is what I have \r\n\r\n` public function scopeTopRatedThisWeek($query)\r\n    {\r\n        return $this->ratings()->where('ratings.created_at', '>=', Carbon::now()->startOfWeek())->avg('rating');\r\n    }`"}}
{"actor":{"display_login":"willvincent"}}