Articles

Laravel 5 Collections: Executing a Function on Collection Elements and Values With mapSpread

Laravel 5 The mapSpread method is used to execute a callback on a collection. If the collection contains nested collections, or Traversable objects, the mapSpread will supply the elements of the nested collections as the...

Laravel 5 Collections: Executing a Function on Collection Elements With eachSpread

Laravel 5 The eachSpread method is used to execute the provided $callback function on each element in the collection. The element's values will become arguments to the callback function. Signature public function...

Laravel 5 Collections: Filtering a Collection Based On Key Presence Using Strict Comparison Operators With whereInStrict

Laravel 5 The whereInStrict method is similar to the whereIn method; the difference is that the whereInStrict method will always use strict comparisons where determining the final collection results. The whereInStrict...

Laravel 5 Collections: Filtering a Collection Based On Key Presence Using Strict Comparison Operators With whereNotInStrict

Laravel 5 The whereNotInStrict method will return all of the items in a collection that do not have matching values (supplied via the $values parameter) for the provided $key. This method is capable of filtering...

Laravel 5 Collections: Filtering a Collection Based On Key Presence With whereIn

Laravel 5 The whereIn method is used to filter the collection based on a given $key and an array of the possible $values that the $key can have. The method also defines an optional $strict parameter, which when an...