I have the code:
$products = Product::whereIn('id_principal_category', $array)->inRandomOrder()->paginate(6);
It sometimes shows me a repeated record.
I have read that I must use whereNotIn, the problem is that it can work if it just one time... but how can i do that if does it have a paginator? because i dont know which the repeated records are and i cant use whereNotIn.. so my question is how can I do that inRandomOrder does not show a repeated record with paginator?
Thanks