Articles

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

Laravel 5 The whereNotIn 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...

Laravel 5 Collections: Filtering Collection Elements Using Strict Comparison Operators With whereStrict

Laravel 5 The whereStrict method is similar to the where method, but it will always use strict comparisons when determining the results to return. Signature public function...

Laravel 5 Collections: Filtering Collection Elements With filter

Laravel 5 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...

Laravel 5 Collections: Filtering Collection Elements With where

Laravel 5 The where method allows developers to filter a collection given a key value pair. It filters the collection's items by checking that the given $key has some value equal to...

Laravel 5 Collections: Filtering Collections With (Without Losing Filtered Rejections) partition

Laravel 5 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...