Articles

Laravel 5 Collections: Creating Combination of Elements With crossJoin

Laravel 5 The crossJoin method is used to join the items within the collection instance with the values of the input arrays, or collections, with all possible permutations expressed. The final output of the crossJoin...

Laravel 5 Collections: Determine Which Collection Elements are Not Present in the Provided Collections With diff

Laravel 5 The diff method is used to determine which items in the collection are not present in the supplied $items collection. $items can be be either an array, or another instance of Collection. The diff method returns...

Laravel 5 Collections: Determining if a Collection Contains an Element Using Strict Comparison With containsStrict

Laravel 5 The containsStrict method is similar to the contains method; it acts as a shortcut to calling the contains method with a strict comparison operator. Signature public function containsStrict( $key, ...

Laravel 5 Collections: Determining If a Collection Contains an Element With contains

Laravel 5 The contains method is used to determine if a given $key exists within the collection. Additionally, an optional $value can be specified that will be used to check if a given key/value pair exists within the...

Laravel 5 Collections: Determining If a Collection Has An Element With has

Laravel 5 The has method is used to determine if a item exists in the collection based on a given $key. The has method returns true if the item exists and false if it does not. Signature public function has( ...