I have the following elements collection and I want to save in a new array only the first elements whose "question_id" field are different from each other. I mean, only the elements with "id" 11 and 12 that have the "question_id" field different, would be saved and the other elements would not be saved in the new array, how could I do it in Laravel?
dump of entities with unique id attributes and just two distinct question_ids