79292256

Date: 2024-12-18 19:24:40
Score: 1.5
Natty:
Report link

Maybe try without a selecting field on unique?

$oldValidUserPremiumPacks->pluck('user_id')->unique();

The contents of $oldValidUserPremiumPacks->pluck('user_id') is: [1, 1, 2, 3]

Therefor $oldValidUserPremiumPacks->pluck('user_id')->unique('user_id') is trying to grab 1->user_id which doesn't work because 1 is an integer, not an object or array.

The contents of $oldValidUserPremiumPacks->unique('user_id') is: [['user_id' => 1], ['user_id' => 2]].

Aww, @TimLewis beat me to it.

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • User mentioned (1): @TimLewis
  • Low reputation (0.5):
Posted by: Magnie Mozios