query that worked in Laravel 5.2 give me error in Laravel 5.3
<p>This query works in 5.2: </p>

<pre><code>    $galleries = Gallery::with(array(
            'images' =&gt; function ($query) {
                $query-&gt;orderBy('order', 'asc');
            }
        ))
        -&gt;with('votes')
        -&gt;leftJoin('votes', 'votes.votable_id', '=', 'gallery.id')
        -&gt;selectRaw(
            'gallery.*, count(case votes.status when "upvote" then 1 else null end) - count(case votes.status when "downvote" then 1 else null end) as points'
        )
        -&gt;where('votes.votable_type','App\Gallery')
        -&gt;groupBy('gallery.id')
        -&gt;orderBy('points', 'desc')
        -&gt;published()-&gt;orderBy('gallery.created_at', 'desc')-&gt;paginate(30);
</code></pre>

<p>I am trying to select all galleries that have votes, when I run this in 5.3 I get this</p>

<pre><code> 1/2 PDOException in Connection.php line 333: SQLSTATE[42000]: 
Syntax error or access violation: 1055 'images.gallery.title' isn't in GROUP BY 

SQLSTATE[42000]: Syntax error or access violation: 1055 'images.gallery.title' isn't in 
GROUP BY (SQL: select gallery.*, count(case votes.status when "upvote" then 1 else null end) - count(case votes.status when "downvote" then 1 else null end) 
as points from `gallery` left join `votes` on `votes`.`votable_id` = `gallery`.`id`
where `votes`.`votable_type` = App\Gallery and `published` = 1 group by `gallery`.`id` 
order by `points` desc, `gallery`.`created_at` desc limit 30 offset 0)
</code></pre>