I mean, I have a referral system which is every parent_id has parent and the parent_id of that parent until it gets to the last parent which is the Senior. Given that a user has purchased an item and it is successful, now I am calling the insertEarnings function to insert the corresponding amount to ..
Category : iteration
I have an array looks like this code bellow: $arr = ["a", "b", "c", 1, 2, 3, 4, 5, 6]; And I use Laravel Collection for this array, so the code looks like this: $collect = collect($arr); What I want is return new collection with array value looks like this: $return_arr = ["a", 1, "b", ..