query that worked in Laravel 5.2 give me error in Laravel 5.3
问题 This query works in 5.2: $galleries = Gallery::with(array( 'images' => function ($query) { $query->orderBy('order', 'asc'); } )) ->with('votes') ->leftJoin('votes', 'votes.votable_id', '=', 'gallery.id') ->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' ) ->where('votes.votable_type','App\Gallery') ->groupBy('gallery.id') ->orderBy('points', 'desc') ->published()->orderBy('gallery