Showing 7 of 1,216 result(s)
The filter method applies a filter to the collection. An optional $callback can be supplied to the filter method. If no $callback is supplied to the filter method, any value in the collection that evaluates to false will be removed from the final...
The intersectByKeys method will return a new collection containing all of the elements of the original collection that are not present in the provided array or collection. The behavior of the intersectByKeys method is similar to PHP's...
The intersect removes any values that are not in the provided $items array. The intersect method returns a new instance of Collection . The intersect method preserves any keys from the original collection. The behavior of the intersect method is...
The partition method is similar to the filter method, in that it allows you to get a subset of a collection based on some truth condition. However, unlike the filter method, the partition method does not discard the elements that failed the truth...
The search method is used to search the collection for a given $value . If the given $value is found, the value's corresponding key is returned. If the $value is not found in the collection, the search method will return false . The search method...
The first method is used to get the first item in a collection, or to get the first item in a collection that matches a set of criteria. A $callback can be supplied to return the first item in the collection that matches a given truth test....
The last method is the logical opposite of the first method, and is used to get the last item in a collection, or to get the last item in a collection that matches a certain criteria. A $callback can be supplied to return the last item in the...