Showing 7 of 1,216 result(s)

/blog/2018/04/22/laravel-5-collections-retrieving-collection-element-values-with-pluck

The pluck method is used to retrieve the a list of values from the collection. It defines two parameters: $value and $key . The $value indicates which property should become the value in the resulting collection and the $key parameter indicates...

/blog/2018/04/22/laravel-5-collections-retrieving-collection-elements-at-a-specific-interval-with-nth

The nth method returns a new collection containing the elements of the original collection that appear at the $step interval (for example, give me every third element within the collection). An $offset may also be specified to indicate which index...

/blog/2018/04/22/laravel-5-collections-retrieving-collection-elements-whose-keys-are-not-present-in-the-provided-keys-with-diffkeys

The diffKeys method is similar to the diff method. It is used to determine which items whose keys in the collection are not present in the supplied $items collection's keys. $items can be either an array, or another instead of Collection .The...

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

The all method can be used to retrieve the underlying array that the collection is using to hold its data.The signature of the all method is: public function all();The following code demonstrates the usage of the all method: After the above code...

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

The get method can be used to retrieve an item from the collection based of its $key . An optional $default argument can be passed that will be returned if the supplied $key does not exists in the collection. The $default argument can be a simple...

/blog/2018/04/22/laravel-5-collections-retrieving-only-the-values-of-a-collections-elements-with-values

The values method can be used to retrieve a new Collection instance containing only the values of the original collection instance. The keys of the new collection will be reset to consecutive numerical keys, starting at zero. The behavior of the...

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

The random method will retrieve a random $amount of items from the collection. By default, the random method will return only one item, however a different $number argument can be supplied to change the number of items returned. If the number of...

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.