Showing 7 of 1,216 result(s)

/blog/2018/04/22/laravel-5-collections-sorting-a-collection-based-on-a-key-value-with-sortby

The sortBy method is useful and versatile way to sort collections by some key, or by some value returned by a $callback . The $callback can either be a function that defines two parameters: $value and $key or the $callback can be the name of some...

/blog/2018/04/22/laravel-5-collections-sorting-a-collection-with-sort

The sort method is used to sort the collection. If no $callback is provided, the collection will be sorted using a case-insensitive "natural order" algorithm. An optional $callback can be supplied to customize the comparison that is used when...

/blog/2018/04/22/laravel-5-collections-splitting-a-collection-into-smaller-pieces-with-chunk

The chunk method is useful when working with large collections in that it allows developers to create smaller collections to work with. The chunk method defines two parameters: $size , which is used to control how large each newly created...

/blog/2018/04/22/laravel-5-collections-static-api-adding-methods-to-the-higher-order-message-list-with-proxy

The proxy static method is used to add additional methods to the list of methods that should be proxied for use with higher order messaging. These proxied methods allow for a cleaner syntax when invoking methods on collections of objects. By...

/blog/2018/04/22/laravel-5-collections-static-api-creating-a-new-collection-instance-from-arrays-using-make

The make static method creates a new instance of a collection with the provided $items (assuming that the provided $items argument is not already a collection instance).The following code sample highlights the usage of the make static method:

/blog/2018/04/22/laravel-5-collections-static-api-ensure-a-value-is-a-collection-with-wrap

The wrap static method is similar to the make static method, except that it will create a collection from any value supplied to it. This method is particularly helpful when writing methods or functions where the a collection instance is...

/blog/2018/04/22/laravel-5-collections-static-api-returning-the-items-of-a-collection-with-unwrap

The unwrap method is the logical opposite of the wrap method, in that if the provided value is already a collection, the collection's underlying items will be returned. If the provided value is not a collection instance, the value is simply...

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.