Showing 7 of 1,216 result(s)
The keys method is used to retrieve the keys of all items in the collection. The keys method returns a new Collection instance. The behavior of the keys method is similar to PHP's array_keys function.public function keys();The following code...
The uniqueStrict method can be used to all of the unique items in the collection; it behaves similarly to the unique collection method in that it accepts an optional $key argument which can be used to restrain the conditional check when...
The unique method can be used to get all the unique items in the collection. It accepts an optional $key argument which can be used to further restrict which items are returned. The unique method returns a new instance of Collection with the items...
The max method can be used to retrieve the maximum value of the given $key . By default, the $key is null and will function in a similar way to PHP's max function.The following code example highlights the usage of max without specifying a $key :...
The diffAssoc method will return the items in the collection where the keys and items are not present in the provided arguments. This method does not modify the original collection; it will return a new collection instance containing the different...
The reverse method is used to reverse the order of items in a collection. The reverse method returns a new Collection instance. The reverse method does not preserve numerical keys but will preserve non-numerical keys. The reverse method is similar...
The sortByDesc method operates exactly the same as the sortBy method. The only differences is that the sortByDesc method does not define a $descending parameter. The sortByDesc method internally makes a call to the sortBy method passing true as...