1Sometime for such queries you need to disable the strict check
2 So inside config/database.php and inside mysql,
3 Set 'strict' => false,
4
5->select('user_id', DB::raw('SUM(points) as total_points'))
1$purchases = DB::table('transactions')
2 ->join('categories', 'transactions.category_id', '=', 'categories.id')
3 ->where('categories.kind', '=', 1)
4 ->sum('transactions.amount');
5