Fix Eloquent pagination when using distinct