Showing 7 of 1,216 result(s)

/blog/2018/04/22/laravel-5-collections-retrieving-the-collection-elements-keys-with-keys

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

/blog/2018/04/22/laravel-5-collections-retrieving-the-distinct-values-of-a-collection-using-strict-comparison-operators-with-uniquestrict

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

/blog/2018/04/22/laravel-5-collections-retrieving-the-distinct-values-of-a-collection-with-unique

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

/blog/2018/04/22/laravel-5-collections-retrieving-the-maximum-value-of-a-collection-with-max

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 :...

/blog/2018/04/22/laravel-5-collections-returning-collection-elements-that-are-not-present-in-the-specified-collections-with-diffassoc

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

/blog/2018/04/22/laravel-5-collections-reversing-the-order-of-collection-elements-with-reverse

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

/blog/2018/04/22/laravel-5-collections-sort-a-collection-in-descending-order-with-sortbydesc

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

Some absolutely amazing
people

The following amazing people help support this site and my open source projects ♥️
If you're interesting in supporting my work and want to show up on this list, check out my GitHub Sponsors Profile.